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   1373 Views

Avatar
snaip

Community Member, 180 Posts

15 January 2010 at 1:38am

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

Community Member, 89 Posts

18 January 2010 at 4:18pm

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.