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.

All other Modules /

Discuss all other Modules here.

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

Subsites and Templates


Go to End


2 Posts   783 Views

Avatar
Kweh

Community Member, 3 Posts

20 December 2014 at 3:21am

Hello,

Long-time user, first-time poster.

I'm using subsites to manage a number of brands under a single group-company. This, by and large has been a great success. However, with things winding down for the holidays, I have taken it upon myself to move away from have a module AND a theme for each brand: historically, we've been maintaining two different git repositories for each brand, and now we have some version number mismatches, and a generally messy (for the developer) process of making changes across multiple different origins.

So, the crux of the matter: subsite1/templates/* and subsite2/templates/* are all present, however, all of the subsite2 templates are overriding the first subsite. i.e. the last-loaded subsite is displaying correctly. Any loaded before it are using the last set of includes (Header.ss etc).

Is there an easy way to tell each subsite module "hey, use THIS set of templates" without needing to fall back on the less-neat themes way of doing things and setting the theme for each subsite?

Avatar
Kweh

Community Member, 3 Posts

29 December 2014 at 10:31pm

OK, so one solution is simply to de-duplicate template file names across all the modules. i.e. the common Header.ss file becomes Brand1Header.ss and Brand2Header.ss and so on.

I'd still like to know if there's some way I can trigger templates to load based on the http request, in the same way as we trigger different subsite content to load depending on the resolved URL using _ss_environment.php