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.

Archive /

Our old forums are still available as a read-only archive.

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

How I can make 3 site view with 1 database


Go to End


2 Posts   1710 Views

Avatar
WebSpilka

Community Member, 89 Posts

4 December 2008 at 9:49pm

how to use one database for multiple patterns simultaneously?
I will be in the 1 site to showcase my designed templates
How could it be implemented?
I think I can help
?theme=mysite1&flush=1
?theme=mysite2&flush=1
?theme=mysite3&flush=1

but what I write in _config.php instead
SSViewer:: set_theme ( 'askold');

Avatar
Willr

Forum Moderator, 5523 Posts

5 December 2008 at 11:12am

Well its basically like how the current theme preview system works - its sets the theme name in the url. So exactly how you have done will work you just need this in your _config file.

Check to see if theme is set otherwise default to 'askold'

// in mysite / _config.php
$theme = (isset($_GET['theme']) ? $_GET['theme'] : 'askold';

SSViewer::set_theme($theme);