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.

Template Questions /

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

Unable to add page type


Go to End


4 Posts   1170 Views

Avatar
Fedorawearingpolarbear

Community Member, 3 Posts

6 March 2012 at 11:36am

I can't for the life of me add a new page type. I have followed the tutorial, searched the forum and I am still unable to have the page type show up in the behaviour tab.

I first create the php file, I name it Test.php.

<?php

class Test extends Page {
static $db = array(
);
static $has_one = array(
);

}

class Test_Controller extends Page_Controller {
   
}
?>

and then I create Test.ss which is a copy of Page.ss. I flush silverstripe with ?flush=all, refresh the admin page, create a page, click the behaviour tab and to my disappointment I only see page, error page, redirect page and virtual page under page type.

Any assistance with this would be much appreciated.

Avatar
Willr

Forum Moderator, 5523 Posts

6 March 2012 at 6:19pm

Have you rebuilt the database? Make sure your Test.php file is in your mysite folder.

Avatar
MCK

Community Member, 18 Posts

6 March 2012 at 6:20pm

Try:

/dev/build?flush=all

and you should be okay.

Avatar
Fedorawearingpolarbear

Community Member, 3 Posts

8 March 2012 at 8:47am

Thank you! It turns out it was my own stupidity, I wasn't typing /dev/ since I thought you was just the a common directory users use to devolop their SilverStripe site.