Welcome to the MetaMod and Chameleon Support Forums.

Before posting, please check out the FAQs.

helpme

 

Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.

 

[Solved] Configure website with 2 domains and 2 templates

[Solved] Configure website with 2 domains and 2 templates

Hello,
I am new here and want some help.
I have 2 domains:
domain1.com.au and domain2.com
Both domains differ in followings:
1. landing page article.
2. Few modules
3. Different template
4. Different menus (only different names but shows same content)
I want to achieve following:
When anyone access domain2.com, it should show different template with different content to the visitor. BUT, only on landing page. And if another menu is clicked, it should assign original template with content same as domain1.com.au

Please help me to get this done.

balista
Beginner Modder
ranks
useravatar
Offline
2 Posts
Administrator has disabled public posting

Re: [Solved] Configure website with 2 domains and 2 templates

Hi Balista,

Chameleon can do all of this apart from handling the modules, which is a job for MetaMod.

I assume from what you are saying that domain2.com will ONLY differ from domain1.com.au when on the front page, and that on ALL other pages of domain2.com, the template, content, menus, modules etc should be exactly the same as domain1.com.au.

So to do this, we're going to set up a rule that detects when we are on the front page of domain2.com. All the actions will take place in the "succeed action" of that rule.

First, the detection side:
- enter domain2.com as the domain
- then you have several options for how to detect that you are on the "front page". This may depend on how your site is set up. The easiest way is actually to detect it by URL, e.g. URL ends in domain2.com/  (so it picks up the www and non-www version). But you might also choose to detect it by page type if your front page has a unique page type, by article id if it's an article, etc. You might also detect it by menu item, remembering that in some cases Joomla will use the same menu item for sub-pages, e.g. the "read more" page for articles linked from the front page, so it's not foolproof.

The actions:
1 - the landing page article. For this I would suggest that you set up 2 front pages, each on a different menu item, and have the menu items next to each other on the main menu. Don't worry, Chameleon can ensure that one of them is always hidden. So in the Succeed action you tell it to hide the one you don't want people to see, and in the Fail action you hide the other one.
2 - the modules: use MetaMod for this
3 - template: in the Succeed action, set the alternative template
4 - different menus: there are a couple of ways you can do this. One way is to set up a 2nd menu structure with the menu manager that mirrors the main one. Each item however is a "menu link" to the corresponding "real" menu item. Then, providing that the menus are being displayed in modules, you can use MetaMod to switch between 2 menu modules (1 linked to 1 menu, and the other linked to the other).
Another way to do the menu switch is similar to how you set up the alternative front pages: make duplicates of all the menu items, and use Chameleon to disable the ones that you don't want to display.
Yet another way is to use some PHP code in the Succeed Action that is able to actually rename the menu items. Do a search in the forum to find how to do that - it's pretty clever.

Hope that helps,
Stephen

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3313 Posts
User info in posts
Administrator has disabled public posting

Re: [Solved] Configure website with 2 domains and 2 templates

Hi Stephen,
That was really helpful. The issue is resolved!
Thank you very much.

balista
Beginner Modder
ranks
useravatar
Offline
2 Posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1667
Total Polls:
6
Total Posts:
5910
Total Posts Today:
1
User Info:
 
Total Users:
10152
Newest User:
kasautiizindagiikay
Members Online:
0
Guests Online:
329

Online: 
There are no members online

Forum Legend:

 Topic
 New
 Locked
 Sticky
 Active
 New/Active
 New/Locked
 New Sticky
 Locked/Active
 Active/Sticky
 Sticky/Locked
 Sticky/Active/Locked