Jump to:

3432 Posts in 1025 Topics by 865 members

Template Questions

SilverStripe Forums » Template Questions » How to create a link to an id

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

Page: 1 2
Go to End
Author Topic: 4544 Views
  • zim
    Avatar
    Community Member
    135 Posts

    Re: How to create a link to an id Link to this post

    Thanks for advice...

    I just came up with a solution wherby I changed this

    new DropdownField('StoryUrl','Select Url:',DataObject::get("SiteTree")->toDropdownMap()),

    to this

    new DropdownField('StoryUrl','Select Url:',DataObject::get("SiteTree")->toDropdownMap("URLSegment", "Title")),

    and now it saves the URLSegment straight off and I do not have to worry about getting link from ID....

    Not sure if my way is ideal so I may well have to use your code so Thanks again.

    4544 Views
Page: 1 2
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.