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're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

Data Model Questions /

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

Conditional redirect page for seasons

Go to End

2 Posts   2676 Views


Community Member, 148 Posts

28 January 2010 at 11:13am

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

+ Seasonal-highlights

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

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?


Community Member, 545 Posts

7 February 2010 at 9:38am

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