Same blog with 2 different domains each with its own header and footer
Permalink
Hi,
I would like to have 2 domains for my website and depending which domain a user arrives on they will have a different header.
The content is exactly the same!
I was thinking of using the Domain Mapper add-on but I want the same content just a differnet theme not a different section of the same website.
Any suggestions?
Cheers
I would like to have 2 domains for my website and depending which domain a user arrives on they will have a different header.
The content is exactly the same!
I was thinking of using the Domain Mapper add-on but I want the same content just a differnet theme not a different section of the same website.
Any suggestions?
Cheers
There is a theme switcher addon. This could be quickly modified to allow to switch via domain.
Cool thanks for that!
My PHP is pretty average... Do you know ifI would modify something in controller.php?
Cheers
My PHP is pretty average... Do you know ifI would modify something in controller.php?
Cheers
It looks like the controller calls
So the dirtiest way would probably just go to models/theme_switcher and change
to
*I think. Test it and let me know.
Events::extend('on_start', 'ThemeSwitcher', 'checkForTheme', './packages/theme_switcher/models/theme_switcher.php');
So the dirtiest way would probably just go to models/theme_switcher and change
if ($_GET['t']) { $theme = PageTheme::getByHandle($_GET['t']); $view->setTheme($theme); } //if the get is not set, then set it from the cookie else if ($_COOKIE['ccmUserTheme']) { $theme = PageTheme::getByHandle($_COOKIE['ccmUserTheme']); $view->setTheme($theme); }
to
*I think. Test it and let me know.
Thats great!
I should have extra domain by afternoon and I will let you know how it goes!
Thanks for the quick posts!
awesome!
Damshaw
I should have extra domain by afternoon and I will let you know how it goes!
Thanks for the quick posts!
awesome!
Damshaw
Hey, Yeah that works almost perfectly!
Except it also applies the theme to the dashboard. Do you know of a way to make an exception for website/index.php/dashboard/
thanks for the help!
damshaw
Except it also applies the theme to the dashboard. Do you know of a way to make an exception for website/index.php/dashboard/
thanks for the help!
damshaw
Did you happen to remove the
part?
The whole theme_switcher.php should look like
if(!$page->isAdminArea() && !$page->isSystemPage()) {
part?
The whole theme_switcher.php should look like
<?php class ThemeSwitcher { public function checkForTheme($view) { //get the current page $page = Page::getCurrentPage(); //get the path of the page, $cpath = $page->getCollectionPath(); //Make sure its not a system page or the login screen or some other pages, we don't wanna theme the Dashboard if (!$page->isAdminArea() && !$page->isSystemPage()) { $domain = $_SERVER['HTTP_HOST']; if (strpos($domain, 'mydomain1.com') !== false) { $view->setTheme('handle_of_theme1'); } elseif (strpos($domain, 'mydomain2.com') !== false) { $view->setTheme('handle_of_theme2'); }
Viewing 15 lines of 19 lines. View entire code block.
Ha! Thanks I should have at least noticed that! You are a legend!!!!!!