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

Redirect to deeply nested Page


Go to End


2 Posts   1175 Views

Avatar
Ironcheese

Community Member, 36 Posts

15 June 2010 at 7:11am

Edited: 15/06/2010 7:12am

Hey there,

how can i redirect from a Controller to a deeply nested Page with only its URLSegment available?

My requested pages will all have the same pattern:
"/maincategory/subcategory/project"

I get the PageObject of my project. So far so good. But the URLSegment of my PageObject is just "project" and not "/maincategory/subcategory/project". So my redirects aint working properly.

Any suggestions?
Thanks

EDIT: i'm using 2.4 with nestedURLs enabled...

Avatar
Willr

Forum Moderator, 5523 Posts

15 June 2010 at 12:32pm

If you have the Page object then you can call a method Link() on it which generates for you the actual nested link.