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.

Archive /

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

TreeDropdownField showing Admin instead of Site Content


Reply


4 Posts   1770 Views

Avatar
RS26

Community Member, 11 Posts

5 December 2008 at 2:46am

Edited: 05/12/2008 2:50am

I am trying to create a drop down menu that displays the pages on my site... but when I use 'TreeDropdownField' it gives me a list of site admin ... not the pages.

Is there anything I'm doing wrong here?

static $has_one = array(
      'BoxTree1' => 'SiteTree'
);

function getCMSFields() {
      $fields->addFieldToTab('Root.Content.Box1', new TreeDropdownField('BoxTree1','More Link'), "SiteTree");   
}

Avatar
jam13

121 Posts

5 December 2008 at 3:22am

Edited: 05/12/2008 3:23am

From memory I think it's like this:

$fields->addFieldToTab('Root.Content.Box1', new TreeDropdownField('BoxTree1ID', 'More Link', 'SiteTree'));

Avatar
RS26

Community Member, 11 Posts

5 December 2008 at 3:42am

Sweet! it worked. This was driving me mad. Thanks man!

Avatar
RS26

Community Member, 11 Posts

5 December 2008 at 4:32am

Edited: 05/12/2008 5:22am

Uh oh... now I have a new problem... how do I return the URL from a selection? It seems to be returning an ID.