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.

extremecreations
 
Mainio replied on at Permalink Reply
Mainio
Yes, this is possible.

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/...
extremecreations replied on at Permalink Reply
extremecreations
This looks like a good addon, but only for different content!

I need the same content from the desktop version on a mobile version.
extremecreations replied on at Permalink Reply
extremecreations
bump
Mainio replied on at Permalink Reply
Mainio
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.
awestrope replied on at Permalink Reply
Did you find a simple solution for this. I need exactly the same. Different domain = different theme but identical content.
ScottSandbakken replied on at Permalink Reply
ScottSandbakken
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');
}
awestrope replied on at Permalink Reply
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?
ScottSandbakken replied on at Permalink Reply
ScottSandbakken
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.
ScottSandbakken replied on at Permalink Reply
ScottSandbakken
Did you get this to work?
awestrope replied on at Permalink Reply
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!