Hi
i have this problem. I have website zetorbar.cz with two subdomains: brandys.zetorbar.cz and liberec.zetorbar.cz.
I have different layout.css files for the subdomains and main domain. What I need is put different content in RightBar directly to subdomain.
I have this code in HomePage.php:
function PostersRight($num=5) {
if ($_SERVER['HTTP_HOST']=="www.zetorbar.cz" || $_SERVER['HTTP_HOST']=="www.zetorbar.cz" )
{
$news = DataObject::get_one("ZetorPostersHolder");
}
elseif ($_SERVER['HTTP_HOST']=="liberec.zetorbar.cz" || $_SERVER['HTTP_HOST']=="liberec.zetorbar.cz" )
{
$news = DataObject::get_one("LiberecPostersHolder");
}
elseif ($_SERVER['HTTP_HOST']=="brandys.zetorbar.cz" || $_SERVER['HTTP_HOST']=="brandys.zetorbar.cz" )
{
$news = DataObject::get_one("BrandysPostersHolder");
}
else
{
$news = DataObject::get_one("ZetorPostersHolder");
}
return ($news) ? DataObject::get("Plakat", "ParentID = $news->ID", "", "", "") : false;
}
It says, that when I open:
liberec.zetorbar.cz, i get LiberecPostersHolder on the RightBar. And its OK
but when I open:
brandys.zetorbar.cz i get ZetorPostersHolder, or
www.zetorbar.cz i get BrandysPostersHolder
In the CMS I have three HomePages. One for www.zetorbar.cz and zetorbar.cz, second for brandys.zetorbar.cz and third for liberec.zetorbar.cz
I use SS 2.4.5