Jump to:

5513 Posts in 1732 Topics by 1218 members

Customising the CMS

SilverStripe Forums » Customising the CMS » Page list optionfield

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

Page: 1
Go to End
Author Topic: 1543 Views
  • Sec
    Avatar
    Community Member
    13 Posts

    Page list optionfield Link to this post

    Hi!

    I have the following line:
    $fields->addFieldToTab('Root.Content.Main', new OptionsetField('Link', 'Link to page:', DataObject::get('Page'),'URLSegment'));

    This list all the pages on my site, only I don't want the list to output the page type (like Page, Article Page, Image Page etc.), but the page URLSegment. How can I get the URLSegment of each page insted where the DataObject::get('Page') is now?            

  • Sec
    Avatar
    Community Member
    13 Posts

    Re: Page list optionfield Link to this post

    Found the solution. Logically you can do DataObject::get('Page')->column('Title') or DataObject::get('Page')->column('URLSegment') to solve this

    1543 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.