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.

Data Model Questions /

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

Advice needed: Multi-langual subsites website


Go to End


5 Posts   1294 Views

Avatar
SanderH

Community Member, 3 Posts

25 October 2016 at 8:35pm

Hello

I'd like some advice on how to best build a project.

This website will contain around 5 smaller sites. The websites will use the same codebase, and more or less the same theme aswell, with css & logo changes. At least 2 of these sites will need to be translated. Some of these sites might also need to have their own templates.

I've been looking at the silverstripe subsites module, which seems quite popular and well maintained. It also looks like its compatible with the Translatable module.

Regarding templates: Would it be possible to have all templates in the mysite folder, which would result in every theme using these templates. If a theme then would have to overwrite one of these templates, it could be done by copying that template into their respective theme?

I've also looked a bit at SilverStripe 4 to get the cascading themes functionality. However it might be to much of a hassle to upgrade each module we use to SilverStripe 4.

My question is: How would you handle this project? Is the subsites module any good?

Avatar
bummzack

Community Member, 904 Posts

25 October 2016 at 9:53pm

The subsites module is an ideal candidate for this. I've also used it for similar things.

Each subsite can have its own theme. And yes, you can put common templates into

mysite/templates
and custom ones into the respective theme folders. As far as I remember, the templates from mysite will have precedence over the ones in themes, so if you need to customize one inside a theme, be sure to remove it from
mysite/templates
and put it into all themes…

If your themes vary only slightly (eg. a change in color or a different logo), you could add this as a setting on the subsite or the SiteConfig (which will also change for each subsite). Then you just use this setting to determine color/logo instead of creating different themes for minimal changes like this.

As for the Translatable integration: I've never used subsites + translatable, but I've successfully used subsites in combination with Fluent.

Avatar
SanderH

Community Member, 3 Posts

25 October 2016 at 10:10pm

@bummzack Thanks for the reply!

As for the templating: I found out that mysite templates would always be taken over theme templates. This can be countered by having the tempaltes in a "module" instead of mysite. That way all sites/themes will use those templates, but can still overwrite them themselves.

Multilingual:
Its cool to hear that Fluent works well with Subsites, since I heard that Translatable also works well (thanks to wmk).

It was brought to my attention that in theory you could also just create a new subsite for a language layer, and dont use Translatable or Fluent at all. Do you have any comments on doing this instead of using a multi lang module?

Avatar
bummzack

Community Member, 904 Posts

25 October 2016 at 10:15pm

I guess you could use subsites for multi-language… eg. da.example.com, en.example.com etc.

Seems to be pretty similar to what Translatable does (create a separate site-tree for every locale), but it will be much harder to establish links between the languages. Eg. if you want to know which page is the translated equivalent in another language, you'll get this with Translatable out-of-the-box. With subsites… not so much ;)

Avatar
SanderH

Community Member, 3 Posts

25 October 2016 at 10:33pm

Ah yes of course.

I think we're going to use the subsites module combined with Translatable, as Translatable seems to fit the client better.

Thanks for the response!