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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Customising the CMS /

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

How to use this UrlSegment-Transformation with another Field than Title


Go to End


2 Posts   1103 Views

Avatar
Lukin

Community Member, 56 Posts

24 March 2011 at 8:21am

HI,

I want another field than Title to be taken as reference for the URLSegmet.

My Field is called Typ which is a dropDown Field.

The selected value has to become the URLSegment.

If I put the selected value into URLSegemet on BeforeWrite it doesn't make the transformation (ü->ue, '->-,etc)

How can I fix this?

Thanks in advance

Salut
Lukin

Avatar
Carbon Crayon

Community Member, 598 Posts

31 March 2011 at 12:11am

Hi Lukin,

You can use:

SiteTree::generateURLSegment($this->YourField);

Hope that helps,

Aram

www.ssbits.com - Your one stop SilverStripe learning resource.