1
I’m cracking my head to set a dynamic folder when opening a popup from Ckfinder. Look at the code below:
// config.js
var finder = new CKFinder();
finder.popup();
// CONFIG.PHP
$baseDir = __DIR__.'/../../biblioteca/';
$baseUrl = '';
I want you to enter a specific folder when you click a button, the folder that is in the button ID. But I couldn’t do it. I think this configuration is interfering with the Config.PHP
Ckfinder. However, if I touch this file, it doesn’t work either.
I tried it this way. But it just opens the POPUP at the root. I don’t know if it’s possible I’m missing the directory. I’m using up a baseURL to not have problems.
– Diego Souza
Try the following changes: 1) on each button, create the data-href="path/of/directory/this/button" 2) in the onClick button event make Finder.popup( $(this).data('href') ).
– marquesini
When leaving Finder.popup directly in config.js, I imagine you are calling it whenever the file runs. This is what is happening?
– marquesini
So, @marquesini, I even put the direct absolute path as a parameter in Ckfinder.popup(). But it still doesn’t redirect to the folder I specified. Also, the Ckfinder screen maximizes when I do this. My Ckfinder opens in an Onclick button event.
– Diego Souza
There is also the possibility to use the method {Undefined} openFolder(resourceType, path), as in the example: Finder.openFolder( 'Images', '/' ).
– marquesini
There’s an example of how to do it ? It’s in the Ckfinder documentation ?
– Diego Souza
Diego, you are in the document yes: http://docs.cksource.com/ckfinder_2.x_api/ Check out the namespace Ckfinder and Ckfinderapi methods.
– marquesini
I took a look, tried it several ways and it didn’t work. But it’s not that urgent. Anyway, thanks.
– Diego Souza