Jump to:

5554 Posts in 1742 Topics by 1227 members

Customising the CMS

SilverStripe Forums » Customising the CMS » Extending LeftAndMain + Templates

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

Page: 1
Go to End
Author Topic: 1979 Views
  • IOTI
    Avatar
    Community Member
    189 Posts

    Extending LeftAndMain + Templates Link to this post

    Hello

    I extended LeftAndMain by creating my own custom class called CalendarPanel.php. I then created template files
    CalendarPanel.ss, CalendarPanel_left.ss, and CalendarPanel_right.ss

    All works fine and dandy but I have to have the templates located in cms/templates or I get errors. Shouldn't I be able to put them in themes/myTheme/templates?

  • JonoM
    Avatar
    Community Member
    103 Posts

    Re: Extending LeftAndMain + Templates Link to this post

    Did you get this working? I'm having exactly the same problem. Followed the instructions here http://doc.silverstripe.org/leftandmain and all works fine if I put my custom templates in the cms->templates folder but if I put it in my site templates folder I get:

    [User Warning] None of these templates can be found in theme '': VimeoAdmin_left.ss, LeftAndMain_left.ss

    Can anyone help?

  • Martijn
    Avatar
    Community Member
    271 Posts

    Re: Extending LeftAndMain + Templates Link to this post

    create a templates/Includes/ folder in your module or in mysite folder...

  • JonoM
    Avatar
    Community Member
    103 Posts

    Re: Extending LeftAndMain + Templates Link to this post

    Hi Martijn,

    I already tried that - I copied the LeftAndMain.ss file to the mysite/templates/Includes from the CMS/templates folder and even created an empty VimeoAdmin_left.ss file in mysite/templates/Includes (I don't actually include that in my VimeoAdmin.ss file though) but I always get an error unless I put VimeoAdmin.ss in the CMS/templates folder.

    Any other ideas?

  • mobius
    Avatar
    Community Member
    54 Posts

    Re: Extending LeftAndMain + Templates Link to this post

    This reply might be too late to help, but standard practice for overriding module themes is to place them in a folder called /themes/yourtheme_modulename. As the CMS is just a module I'd suggest /themes/yourtheme_cms

  • mobius
    Avatar
    Community Member
    54 Posts

    Re: Extending LeftAndMain + Templates Link to this post

    Sorry, I've just tried it now - turns out I was wrong in this case: there is no 'theme' selected when you're in the backend. To get it to work, you put it in /mysite/templates/Includes/ClassName_left.ss (and ClassName_right.ss)

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