Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Customising the CMS

TreeDropdownField with only one folder


Reply

2 Posts   1324 Views

Avatar
snaip

15 January 2010 at 1:38am Community Member, 180 Posts

hi

i'm using TreeDropdownField to get file from assets folders
but it showing me all the folders in asset , i want only one

i have
/assets
..../images
..../pdf
..../flash

i want to get only pdf folder in TreeDropdownField

static $has_one = array(
'PDF' => 'File'
);
$fields->addFieldToTab("Root.Content.Plik pdf", new TreeDropdownField('PDFID', 'Choose pdf file', 'File'));

Avatar
MateuszU

18 January 2010 at 4:18pm Community Member, 89 Posts

How about this:

$tree = new TreeDropdownField('PDFID', 'Choose pdf file', 'File');
$tree->setTreeBaseID([the id of the root folder to browse]);
$fields->addFieldToTab("Root.Content.Plik pdf", $tree);

m.