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.

Template Questions /

Unable to add page type


Reply


4 Posts   519 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, 5513 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, 9 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.