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.

Data Model Questions /

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

Conditional redirect page for seasons


Go to End


2 Posts   3069 Views

Avatar
NickJacobs

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

Avatar
zenmonkey

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