Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » TreeDropdownField showing Admin instead of Site Content

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

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

Page: 1
Go to End
Author Topic: 1666 Views
  • RS26
    Avatar
    Community Member
    11 Posts

    TreeDropdownField showing Admin instead of Site Content Link to this post

    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");   
    }

  • jam13
    Avatar
    121 Posts

    Re: TreeDropdownField showing Admin instead of Site Content Link to this post

    From memory I think it's like this:

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

  • RS26
    Avatar
    Community Member
    11 Posts

    Re: TreeDropdownField showing Admin instead of Site Content Link to this post

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

  • RS26
    Avatar
    Community Member
    11 Posts

    Re: TreeDropdownField showing Admin instead of Site Content Link to this post

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

    1666 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.