Jump to:

23490 Posts in 18996 Topics by 2878 members

General Questions

SilverStripe Forums » General Questions » How to get Silverstripe to use templates in <mysite> folder

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: 317 Views
  • Schippie
    Avatar
    Community Member
    32 Posts

    How to get Silverstripe to use templates in <mysite> folder Link to this post

    I probably have a really silly question but i cannot get my homepage.php to use the homepage.ss template located in <mysite>/templates/homepage.ss It just reverts back to the default silverstripe theme for some reason.

    I would like to use the mysite folder for the reason that i want to have all files in one folder nicely grouped together css js php and templates.
    But i cannot seem to get it to use those templates.

    It when i flush=all / 1 gives timeout errors/exceeding memory limit and when i remove the cache manually from the appdata it reverts back to the default theme.

    PS: i posted this i think in the wrong section if somebody could move it for me :S

  • Bambii7
    Avatar
    Community Member
    254 Posts

    Re: How to get Silverstripe to use templates in <mysite> folder Link to this post

    Hi Schippie,
    could you check/post your classes in side homepage.php

    for example I have

    class HomePage extends Page
    class HomePage_Controller extends Page_Controller


    Then I have HomePage.ss

  • Schippie
    Avatar
    Community Member
    32 Posts

    Re: How to get Silverstripe to use templates in <mysite> folder Link to this post

    They indeed extend from the default Page classes and not from the sitetree / contentcontroller classes.
    I would be able to post some code but only in a few hours. Posted it as a question after work and have the code only available to me at work.

  • Schippie
    Avatar
    Community Member
    32 Posts

    Re: How to get Silverstripe to use templates in <mysite> folder Link to this post

    Turns out i had written the HomePage class name as HomaPage never noticed yesterday. Though that brings me more or less to the next problem that is that <% include HeaderHome %> was the cause of the timeout errors. While the file is simply within the templates folder like : <mysite>/templates/Includes/HeaderHome.ss.

    Edit: after some more searching i found the problem in the form of old code still left in that template before the switch to 3.1 where we decided to redo most of the templates/javascript etc. turns out including footer.ss within footer.ss is not a great idea

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