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.

Themes /

Discuss SilverStripe Themes.

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

Multiple Page Types


Reply


3 Posts   1414 Views

Avatar
jaedb

Community Member, 5 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, 5513 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!