Jump to:

23007 Posts in 11866 Topics by 2828 members

General Questions

SilverStripe Forums » General Questions » Problem adding new page type

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Page: 1
Go to End
Author Topic: 1135 Views
  • quiet_islander
    Avatar
    Community Member
    17 Posts

    Problem adding new page type Link to this post

    Hi, everyone:

    I am going through the tutorials on my local PC running XAMPP. I have successfully added a new "Home" page type as explained in tutorial 1. However when it comes to add another two page types -- "Article" and "Article Holder" in tutorial 2, something strange happened.

    As soon as I added these two php files into the mysite/code folder and updated the database, the CSS of the main site(on empty theme) will be broken. The dark grey footer with links to CMS, draft site etc would be brought up to be just below the content. This footer should ideally always stay at real bottom of the page no matter how long the content is.

    Another problem is that after adding the two page types, I could never log in to the CMS again. Whenever I clicked on the log in button, I saw an error page saying "Security.SS not found" and something like that.

    I have tried to add the "Article" and "Article Holder" page type first and then the "Home" but the problem remained. But if I only added the "Article" and "Article Holder" there would be no problem. So I am suspecting that it is the "Home" page type conflicting with the other two.

    I am absolutely new to Silverstripe. If anyone can give me a hand, that would be much appreciated.

  • Aram
    Avatar
    Community Member
    598 Posts

    Re: Problem adding new page type Link to this post

    Hi Quiet Islander,

    Could you post your code for the home page, post it into pastie.org rather than directly onto the forum, then post the link.

    Aram

  • quiet_islander
    Avatar
    Community Member
    17 Posts

    Re: Problem adding new page type Link to this post

    hi, aram:

    I just copied and pasted the code from the tutorial and did nothing special.

    For some reason, I can't open the pastie.org site at the moment but will try it again.

  • Pigeon
    Avatar
    Community Member
    243 Posts

    Re: Problem adding new page type Link to this post

    As a stab in the dark, take a look at the controllers for your page types.

    Makesure they are all of the form ClassName_Controller extends Page_Controller (where ClassName is the name of the PageType). And that if you are using the init() function, that you call parent::init() in there somewhere. Are you using the Page_Controller init method to 'require' the CSS files? If so, you might be over-riding them or something similar.

    But as Aram says, taking a look at the code would be best. You can 'attach' it to a forum post too.

  • quiet_islander
    Avatar
    Community Member
    17 Posts

    Re: Problem adding new page type Link to this post

    I have attached the two php files I added to the mysite/code folder and the screenshot of broken CSS.

    I first put the HomePage.php file there and built the database by appending dev/build?flush=1 to the url. Everything worked fine at this point. I could see the "home page" added as an option in the add new page dropdown in CMS.

    When I added the ArticlePage.php and rebuilt the database again the problem immediately arose. As you can see in error.jpg and error2.jpg, the CSS is broken in both front end and CMS.

    Attached Files
  • Aram
    Avatar
    Community Member
    598 Posts

    Re: Problem adding new page type Link to this post

    hmm, nothing wrong with those two, could you post ur other files, templates too.

    Aram

  • quiet_islander
    Avatar
    Community Member
    17 Posts

    Re: Problem adding new page type Link to this post

    I didn't even touch the template files.

    I am going to try it on a real server and see if the problem only appears on XAMPP.

    1135 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.