Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Customising the CMS /

Extending LeftAndMain + Templates


Reply


6 Posts   2014 Views

Avatar
copernican

Community Member, 189 Posts

1 July 2010 at 2:13am

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?

Avatar
JonoM

Community Member, 103 Posts

14 November 2010 at 11:32am

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?

Avatar
Martijn

Community Member, 271 Posts

15 November 2010 at 1:43am

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

Avatar
JonoM

Community Member, 103 Posts

6 December 2010 at 3:54pm

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?

Avatar
mobius

Community Member, 54 Posts

10 February 2011 at 8:19am

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

Avatar
mobius

Community Member, 54 Posts

10 February 2011 at 8:38am

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)