Jump to:

5450 Posts in 1672 Topics by 1197 members

Customising the CMS

SilverStripe Forums » Customising the CMS » Redirect to deeply nested Page

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

Page: 1
Go to End
Author Topic: 807 Views
  • Ironcheese
    Avatar
    Community Member
    33 Posts

    Redirect to deeply nested Page Link to this post

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

  • Willr
    Avatar
    Forum Moderator
    5462 Posts

    Re: Redirect to deeply nested Page Link to this post

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

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