Hi guys,
I'm experiencing a problem with creating a field (for a Page type class) to select a folder from assets (e.g. gallery).
As I've read and looked up in a module (ImageGallery basic) to make such a field one should use TreeDropdownField.
But when it comes to the real deal - the dropdown shows "loading..." and error pops up "Error getting data".
This is the implementation i used (folder option in ImageGallery basic is not working for me as well):
class TestPage extends Page {
static $db = array();
static $has_one = array(
"SourceFolder" => "Folder"
);
function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldToTab("Root.Content.Main", new TreeDropdownField("SourceFolderID", "Source Folder", "Folder"));
return $fields;
}
}
Using version 2.4.7.
Thanks in advance. I'll be contributing some useful modules/widgets if you help me on this :)