Use a different theme for a sub domain (same content)
Permalink 1 user found helpful
Is this possible in C5 to use a different theme for say mobile.website.com ?
I'm trying to get around using mobile theme switchers(which automatically set a cookie) due to the eu cookie law.
I'm trying to get around using mobile theme switchers(which automatically set a cookie) due to the eu cookie law.
This looks like a good addon, but only for different content!
I need the same content from the desktop version on a mobile version.
I need the same content from the desktop version on a mobile version.
bump
Oh, ok, then I'd probably do that just by customizing the mobile theme switcher (or its alternatives) so that it would force the mobile theme in that subdomain.
Did you find a simple solution for this. I need exactly the same. Different domain = different theme but identical content.
In your [root]/config.php file, set the theme for the view based on the domain name.
$v = View::getInstance(); $domain = $_SERVER['HTTP_HOST']; if ($domain == 'mobile.website.com') { $v->setTheme('theme_handle_one'); } else { $v->setTheme('theme_handle_two'); }
There was no config.php file in my root so I created one and pasted your code, changed to my theme names & hosts but no joy?
Sorry. I messed up the path. The file is [root]\config\site_theme_paths.php
Be sure to backup this file before you change it.
Be sure to backup this file before you change it.
Did you get this to work?
I eneded up modifying the free theme switcher add-on in the end. Mostly because this included code to check to see if the page being viewed was dashboard and if no not apply the theme. there is no reason no now to go back and put this code where you suggested but once I had it working I moved onto the next thing!
You can already setup the theme page specifically from the "Design" menu of each of your pages, I suppose you already know that.
And for the separated domains here's an add-on you might want to take a look at:
http://www.concrete5.org/marketplace/addons/multiple-domains/...