Welcome to the MetaMod and Chameleon Support Forums.

Before posting, please check out the FAQs.



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


Use MetaTemplate to deliver Virtual Domains functionality -only better

Use MetaTemplate to deliver Virtual Domains functionality -only better

The Virtual Domains extion can be found here:
http://extensions.joomla.org/extensions … sites/7557

I attempted to use it to define an alternate home page and alternate template when the site was accessed through an aliased domain. 

-PrimaryDomain.com has its own normal front page and template
-SecondDomain.com points to the same Joomla build as PrimaryDomain.com, but has a unique front page (component) and unique template

It worked pretty well but there were some bugs.  It is important in my case to be able to present a different home page, different component etc, not just different modules (and template).

As I recall, one of the problems was that it was not possible to register in Community Builder while browsing the site in the aliased domain.

FYI, one quirk that I observed with that extension at the time (Oct 2009) was that the module assignments for the PrimaryDomain front page were present on the SecondDomain front page - along with any modules assigned exclusively to the SecondDomain front page.  I imagine that with your expertise, such a conflict would not occur. 

Anyway, I guess my question is, if you are aware of what that extension is trying to do, if you think that perhaps MetaTemplate (with metamod) are a better solution.

If so, how would I conquer the issue about having a different component for the SecondDomain home page, and also forcing a switch to the PrimaryDomain when CB registration is accessed, for instance.

Thanks in advance.

Beginner Modder
1 Posts
Administrator has disabled public posting

Re: Use MetaTemplate to deliver Virtual Domains functionality -only better

Hi Bert,

sorry for not getting back to you sooner. I've been thinking quite a lot about this.

I was about to write "Sorry, neither MetaMod nor MetaTemplate address changing the Default Menu Item", but I decided to look inside Joomla just to check how hard it would be... and found that it may not be so difficult after all smile

Now, I don't know if this is going to work any better than the Virtual Domains extension, regarding the issues that you cited. However it's worth a try.

Essentially, all you need to do to switch the "default menu item", is to get hold of the relevant menu item id from the Menu Manager. Then, use the following code inside the PHP box in the SUCCEED or FAIL actions in MetaTemplate(/Pro):

$menu = &JSite::getMenu();
$menu->setDefault(XXX);// replace XXX with the menu id (Itemid) of the menu item that you want to be default.

This should make it super-easy to set the template and the default menu item for any rule, using MetaTemplate(/Pro). You can then use MetaMod to change the modules for any given template, so that takes care of the modules too.

I hope it shouldn't be too hard to design a rule that switches to the PrimaryDomain when CB registration is accessed. You could detect it with the "Page URL" textbox (or perhaps the Domain and/or Component depending on your needs), then with the SUCCEED rule switch to an alternative URL.

Hope all that helps,
I'm considering building in a "change default page" control to the next version of MetaTemplate(/Pro) as it's such a great idea! (thanks...)

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

3330 Posts
User info in posts
Administrator has disabled public posting

Board Info

Board Stats:
Total Topics:
Total Polls:
Total Posts:
Total Posts Today:
User Info:
Total Users:
Newest User:
Members Online:
Guests Online:


Forum Legend:

 New Sticky