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.

Themes /

Discuss SilverStripe Themes.

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

Multiple Page Types


Go to End


3 Posts   2417 Views

Avatar
jaedb

Community Member, 6 Posts

21 April 2011 at 12:18pm

I'm wanting to create a page that is a Redirector page but also has a custom page template. I know I can do this by creating a new CMS field but I really want to avoid this as the website is over-complicated already.

Is there any way that a page can be both a RedirectorPage and a custom Page?

Avatar
Willr

Forum Moderator, 5523 Posts

8 June 2011 at 7:42pm

Is there any way that a page can be both a RedirectorPage and a custom Page?

Use SiteTreeDecorator to decorate the RedirectorPage or subclass the RedirectorPage class with your custom class.

<?php

class CustomRedirectorPage extends RedirectorPage {

  //.. your custom code.
}

class CustomRedirectorPage_Controller extends RedirectorPage_Controller {

}

Avatar
hammuh

Community Member, 15 Posts

8 June 2011 at 7:44pm

so if I understand... you want a page that is sometimes a redirectorpage and an othet time a normal page? In that case just switch from page type in the behaviour tab.

If you want to have all the functionality in one page, let me know. I already made something like that!