Jump to:

3448 Posts in 1062 Topics by 738 members

Data Model Questions

SilverStripe Forums » Data Model Questions » Conditional redirect page for seasons

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

Page: 1
Go to End
Author Topic: 1528 Views
  • NickJacobs
    Avatar
    Community Member
    144 Posts

    Conditional redirect page for seasons Link to this post

    In a site under development I have a series of pages which show seasonal highlights, ie:

    + Seasonal-highlights
    -Spring
    -Summer
    -Autumn
    -Winter

    Seasonal-highlights is a redirector page type, and I want it to redirect to one of the children based on a month value

    ie:
    if month=12,1,2 -> summer
    if month=3,4,5 -> autumn
    if month=6,7,8 -> winter
    if month=9,10,11 -> spring

    Is it possible to alter/override the redirector page behaviour?

  • zenmonkey
    Avatar
    Community Member
    528 Posts

    Re: Conditional redirect page for seasons Link to this post

    You can either extend the Redirector Page type and create your own class the same way you extend any page just instead of Pagetype extends Page you use PageType extends RedirectorPage just make sure you still extend the Page Controller. Or you could copy the contents of Redirector page into a new page type and add any functionality to that

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