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

Page list optionfield


2 Posts   1575 Views


7 January 2009 at 9:45pm Community Member, 13 Posts


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?            


7 January 2009 at 9:56pm (Last edited: 7 January 2009 9:56pm), Community Member, 13 Posts

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