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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Template Questions /

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

Theme in cms/templates rendered rather than template file in my theme folder


Go to End


6 Posts   1823 Views

Avatar
pali

Community Member, 33 Posts

13 May 2009 at 11:32pm

hello,

i copied cms/templates/PageCommentInterface.ss to themes/mytheme/templates/Includes but the site is still using cms's one :(
If i remove cms/templates/PageCommentInterface.ss everything is OK. It looks like mytheme ss file has not higher priority :(

other templates working fine from mytheme folder.

regards

pali

Avatar
Willr

Forum Moderator, 5523 Posts

15 May 2009 at 12:11pm

You should keep your paths the same

Eg cms/templates/PageCommentInterface.ss -> Should go to themes/yourtheme/templates/PageCommentInterface.ss not in the Includes folder

Avatar
pali

Community Member, 33 Posts

15 May 2009 at 8:07pm

thanks will,

helped.

i would like to have structure of themes like this: themes/travelpoint/templates/Modules/cms/ and here same files as in cms/templates... With this construction arent working "root" teplates, only these included in folders (layout, includes...)... if i place content of cms/templates/ folder into themes/travelpoint/templates/Modules/cms/templates/ everything is OK.

is this bug or behaviour?

regards

pali

Avatar
Willr

Forum Moderator, 5523 Posts

15 May 2009 at 8:54pm

I have never tried this but normally when you want to theme modules you create a 'yourtheme_modulename' folder in themes. SSViewer looks for this folder first for the file, if it doesn't exist then it defaults to the modulename/ folder so I believe you *could* possibly create a yourtheme_cms/ folder then inside that have css/ images/ templates (just like the root theme) and then inside templates have the templates you wish to override.

Most of the time however people just keep the cms templates they wish to override in the root theme.

Avatar
pali

Community Member, 33 Posts

15 May 2009 at 9:09pm

hmm, so i should create themes/mytheme_cms/... and here place custom stuff?

sounds good too.

thanks

Avatar
pali

Community Member, 33 Posts

15 May 2009 at 9:14pm

working - great, and makes much more sense... thanks will