Jump to:

3445 Posts in 1031 Topics by 872 members

Template Questions

SilverStripe Forums » Template Questions » Cannot select page type in admin panel

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

Page: 1
Go to End
Author Topic: 557 Views
  • Loopy
    Community Member
    20 Posts

    Cannot select page type in admin panel Link to this post


    I have created a new page type called HomePage. To do this I have created a Homepage.php file which is located at mysite/code/HomePage.php and I have a file called HomePage.ss located at template/Homepage.ss. I have run dev/build?flush=1 and ?flush=all and I have a file in site root called silverstripe-cache at SilverStripe/silverstripe-cache set to read / write and again run dev/build?flush=1 and ?flush=all.

    when I go to the admin panel i can see the option Change to HomePage in the page type drop down menu. It allows me to select this option but when I save it changes the page type to Change to Error Page and then saves it as that page type.

    This then returns the statement "Generated with the default ContentController.ss template" on the site for that page but all other pages are ok.

    One final thing: I have a <form action="url" method="get" </form> statement and a <script type="text/javascript" src="url"></script> statement coded into the HomePage.ss immediately after the <div id="Layout"> $Layout</div> statement.

    Can anyone tell me where I have gone wrong?

  • Futureweb
    Community Member
    232 Posts

    Re: Cannot select page type in admin panel Link to this post

    I've had this happen when I've created a new page type, run dev/build, created a page based in this new page type, then removed the php files, run dev/build to clear the database, and then uploaded new versions of the php files, and dev/build again.

    I've solved the problem in these cases by going directly into the database, finding the page in the sitetree table, and changing the page type back to 'Page'. Reloading the CMS, and then it lets me choose the right page type again..

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.