Monday 15 September 2014

php - Joomla different default page based on URL for microsites -


I am currently creating a template for a client that, under an example of Joomla, many microsites and a master Wants to create a site I am making it in Joomla, because I know it, so please do not suggest another CMS, and yes, I know that Drupal supports this naturally! So here's my template template from Param for a domain name and then after comparing the base URI and then sets the variables used in all the templates, the code looks like this ...

  // multisite configuration - determines which template parameter and menu module will be displayed based on the base URL url = JURI :: base (); $ Primary = 'http: //'.$this-> Params-> Get ('site-domain'). ' / '; $ Sub1 = 'http: //'.$this-> Params-> Obtain ('domain1-domain'). ' / '; $ Sub2 = 'http: //'.$this-> Params-> Obtain ('domain2-domain'). ' / '; $ Sub3 = 'http: //'.$this-> Params-> Obtain ('domain3-domain'). ' / '; $ Sub4 = 'http: //'.$this-> Params-> Obtain ('domain4-domain'). ' / '; $ Sub5 = 'http: //'.$this-> Params-> Obtain ('domain5-domain'). ' / '; If ($ url == $ primary): $ logo = $ it- & gt; Parameters-> Get ('logo'); $ Title = $ it-> Parameters-> Obtain ('Site-Title'); $ Slogan = $ this- & gt; Parameters-> Receive ('site-slogan'); $ Menu = '& lt; Jdoc: include = "module" name = "menu" />; '; Otherwise ($ url == $ sub1): $ logo = $ it- & gt; Parameters-> Obtain ('domain1-logo'); $ Title = $ it-> Parameters-> Obtain ('domain1-title'); $ Slogan = $ this- & gt; Parameters-> Obtain ('domain1-slogan'); $ Menu = '& lt; Jdoc: included type = "module" name = "menu-1" />; '; Otherwise ($ url == $ sub2): $ logo = $ it- & gt; Parameters-> Obtain ('domain2-logo'); $ Title = $ it-> Parameters-> Obtain ('domain2-title'); $ Slogan = $ this- & gt; Parameters-> Obtain ('domain 2-slogan'); $ Menu = '& lt; Jdoc: included type = "module" name = "menu-2" />; '; Otherwise ($ url == $ sub3): $ logo = $ it- & gt; Parameters-> Obtain ('domain3-logo'); $ Title = $ it-> Parameters-> Obtain ('domain3-title'); $ Slogan = $ it- & gt; Parameters-> Obtain ('domain 3-slogan'); $ Menu = '& lt; Jdoc: include = "module" name = "menu-3" />; '; Otherwise ($ url == $ sub4): $ logo = $ it- & gt; Parameters-> Obtain ('domain4-logo'); $ Title = $ it-> Parameters-> Obtain ('domain4-title'); $ Slogan = $ it- & gt; Parameters-> Obtain ('domain4-slogan'); $ Menu = '& lt; Jdoc: include = "module" name = "menu-4" />; '; Otherwise ($ url == $ sub5): $ logo = $ it- & gt; Parameters-> Obtain ('domain5-logo'); $ Title = $ it-> Parameters-> Obtain ('domain5-title'); $ Slogan = $ this- & gt; Parameters-> Obtain ('domain 5-slogan'); $ Menu = '& lt; Jdoc: include = "module" name = "menu -5" />; '; end if;   

So whatever I have to do now, I will create a template parameter that determines whether the menu item ID is the default menu item and then redirects a PHP header. Since Joomla does not support many defaults, I need almost one work to generate the necessary redirect URL. I am thinking of the menu item id or surname because I do not want to be limited to the performance of a category or article type. Unfortunately, to solve it, where my knowledge of PHP and Joomla is short. Any help would be great.

Thanks Sandra :)

You can use an extension like this instead , Which allows you to associate different domains with different default menu items, then you can use standard Joomla templates and assign them on a menu basis.

No comments:

Post a Comment