I have created several sites with their own theme using Silverstripe 2.3 without difficulty and am now doing my first site with 2.4. After setting the default theme in the config file. I have found that if I have the directory structure
/themes/mytheme/templates/Layout/MyTemplate.ss
as I have always done before then my template is not found and displayed. However if I follow the example of the new structure blackcandy has and use
/themes/mytheme/mytheme/templates/Layout/MyTemplate.ss
then it is found. However this means that things like the template variable $ThemeDir need to be used as
$ThemeDir/mytheme/images etc
which is a bit nonsensical as it is meant to do away with naming a theme dependent directory. I can't find anything about this in the documentation or forums. Have I got this right or am I missing something somewhere?
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.
doesn't sound right to me... I use 2.4.x only and I've never seen this...
/themes/mytheme/mytheme/templates/Layout/MyTemplate.ss
Why do you have mytheme inside mytheme? That isn't required. $ThemeDir should return themes/mytheme/
I started development with blackcandy checked out from github about 3 weeks ago. That has /themes/blackcandy/blackcandy/templates etc for the main blackcandy theme css/images/templates . I found that if I didn't mirror this structure for my theme then my templates were not found. This is why I have /themes/mytheme/mytheme. I would like to get rid of this double directory layer it feels very cumbersome but I need my templates to be findable.
This is why I have /themes/mytheme/mytheme. I would like to get rid of this double directory layer it feels very cumbersome but I need my templates to be findable.
Don't use the double layer. All themes should go in the root themes/ dir. It is likely you had problems with moving it up a level perhaps because you didn't run ?flush=1. Just to clear, your themes folder will need to look something like https://skitch.com/willrossi/r4nf4/templates