Jump to:

3443 Posts in 1030 Topics by 871 members

Template Questions

SilverStripe Forums » Template Questions » Unable to add page type

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

Page: 1
Go to End
Author Topic: 477 Views
  • Fedorawearingpolarbear
    Avatar
    Community Member
    3 Posts

    Unable to add page type Link to this post

    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.

  • Willr
    Avatar
    Forum Moderator
    5497 Posts

    Re: Unable to add page type Link to this post

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

  • MCK
    Avatar
    Community Member
    9 Posts

    Re: Unable to add page type Link to this post

    Try:

    /dev/build?flush=all

    and you should be okay.

  • Fedorawearingpolarbear
    Avatar
    Community Member
    3 Posts

    Re: Unable to add page type Link to this post

    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.

    477 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.