3214 Posts in 848 Topics by 810 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 721 Views |
-
Can you have all theme files in one directory tree?

12 October 2009 at 8:55am
Is it possible to put all of the theme files in a single directory tree to make them easier to manage?
For example if I'm running Silverstripe with the blogging module the theme files seem to live in the following places:
/blog/css
/blog/images
/blog/templates
/themes/mytheme/css
/themes/mytheme/images
/themes/mytheme/templates
/themes/mytheme_blog/css
/themes/mytheme_blog/images
/themes/mytheme_blog/templatesAdding additional modules increases this complexity even further.
For ease of management I'd like to store everything theme related in one place - for example:
/themes/mytheme/css
/themes/mytheme/images
/themes/mytheme/templatesIs there any process/ trick/ switch/ easy hack to allow me to do this?
Cheers
Tama -
Re: Can you have all theme files in one directory tree?

12 October 2009 at 9:23am
I would have thought that the files for modules could have gone into themes/mysite/templates/
I am pretty sure the template engine looks for templates in this order
Looking for the 'BlogHolder' template
1 Your custom themes module folder (themes/mytheme_blog/templates/)
2 Your custom theme folder (themes/mytheme/templates/)
3 The default location (blog/templates)You shouldn't need to edit the templates in blog/ You should simply copy the files you want to override into the themes/mytheme/templates/ directory and edit them there.
So in conclusion - yes I believe you can keep all the template files in themes/mytheme/templates* and SS will still pick it up
-
Re: Can you have all theme files in one directory tree?

12 October 2009 at 9:39am
Hi Will - thanks for the prompt reply, it's really appreciated.
I wondered if this was the case but my site didn't seem to be overriding changes to /themes/mytheme/templates from /blog/templates so I wasn't sure about the priority. The addition of /themes/mytheme_blog threw me a little too.
With what you wrote in mind I'll rationalise all of the my theme files into one directory tree and go from there.
Thanks again
Tama
| 721 Views | ||
|
Page:
1
|
Go to Top |


