I am building a template right now for a client that wants to have multiple microsites and one master site under one instance of joomla. I'm building it in Joomla, because that is what I know, so please don't suggest another CMS, and yes I know Drupal supports this inherently! So here is the skinny. Right now my template looks for a domain name from the template params and then compares that to the base URI and then sets the variables to be used throughout the templates. So the code looks like this...
//multisite configuration - determines which template params and menu module to display depending on the base URL
$url = JURI::base();
$primary = 'http://'.$this->params->get('site-domain').'/';
$sub1= 'http://'.$this->params->get('domain1-domain').'/';
$sub2= 'http://'.$this->params->get('domain2-domain').'/';
$sub3= 'http://'.$this->params->get('domain3-domain').'/';
$sub4= 'http://'.$this->params->get('domain4-domain').'/';
$sub5= 'http://'.$this->params->get('domain5-domain').'/';
if($url == $primary):
$logo = $this->params->get('logo');
$title = $this->params->get('site-title');
$slogan = $this->params->get('site-slogan');
$menu = '<jdoc:include type="modules" name="menu" />';
elseif($url == $sub1):
$logo = $this->params->get('domain1-logo');
$title = $this->params->get('domain1-title');
$slogan = $this->params->get('domain1-slogan');
$menu = '<jdoc:include type="modules" name="menu-1" />';
elseif($url == $sub2):
$logo = $this->params->get('domain2-logo');
$title = $this->params->get('domain2-title');
$slogan = $this->params->get('domain2-slogan');
$menu = '<jdoc:include type="modules" name="menu-2" />';
elseif($url == $sub3):
$logo = $this->params->get('domain3-logo');
$title = $this->params->get('domain3-title');
$slogan = $this->params->get('domain3-slogan');
$menu = '<jdoc:include type="modules" name="menu-3" />';
elseif($url == $sub4):
$logo = $this->params->get('domain4-logo');
$title = $this->params->get('domain4-title');
$slogan = $this->params->get('domain4-slogan');
$menu = '<jdoc:include type="modules" name="menu-4" />';
elseif($url == $sub5):
$logo = $this->params->get('domain5-logo');
$title = $this->params->get('domain5-title');
$slogan = $this->params->get('domain5-slogan');
$menu = '<jdoc:include type="modules" name="menu-5" />';
endif;
So now what i need to do is build a template parameter that determines what menu item ID is default menu item and then do a PHP header redirect. Since Joomla does not support multiple defaults, I need a work around to generate the necessary redirect URL. I am thinking by menu item id or alias as I dont want to be limited to a category or article type display. Unfortunately solving this is where my knowledge of PHP and Joomla fall short. Any help would be great.
Thanks Sandra :)