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.

 

Module based on template

Module based on template

Hello everyone,

Here is my config : Joomla! 1.7.1 and Metamod 3.7.
I am trying to use the metamod recipe : "Control modules based on selected Joomla template" but I can't get it to work, and when i read the metamod help in the module, it doesn't seem we can use the template variable.

Is there a possibility to achive that ?
I am using one template for general purpose, and one for mobile display, so I would like to show different modules in the content in function of the type of visitor smile

Any idea ?

Thank you !

Guillaume
http://www.cequejendis.com/

LaGriff
Beginner Modder
ranks
useravatar
Offline
5 Posts
Administrator has disabled public posting

Re: Module based on template

Hi Guillaume,

sadly, the recipe for determining the template was written for Joomla 1.5, and it's evidently not working on J1.7. The whole template/style thing is vastly different on 1.7 so I am not surprised it doesn't work.

Are you using different templates for the different browser types, or different styles of the same template? It's probably easier to detect different templates than it is different styles... so I hope that's what you're after!

Coming to think of it... what system are you using for detecting the different browsers and switching to the different templates/styles? Is that a function in your template (e.g. a RocketTheme/Yootheme thing), or perhaps with Chameleon? I can certainly show you how to solve this if you're using Chameleon... the others may not be so straightforward.

Best regards,
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
3319 Posts
User info in posts
Administrator has disabled public posting

Re: Module based on template

Hi Stephen,

I am actually using http://www.mobilejoomla.com/ to generate the mobile template and it takes care of the user agent detection, I really have no idea on how it is working...

I actually managed to do what I wanted with another component (Advanced Module Manager) but I would have really liked to manage it with your module as I really like it smile and I don't like installing too many things on a "fresh" Joomla installation. I suppose it would help other people to know how to do this.

Now to answer your questions, those are not different styles, but really different templates.

If you have ideas, I will try them, it may be useful for other people later, and make a new recipe wink I was already the one who had asked for the "Control modules based on article author" big_smile

Thanks for your help !

Guillaume

LaGriff
Beginner Modder
ranks
useravatar
Offline
5 Posts
Administrator has disabled public posting

Re: Module based on template

Actually, the old recipe still seems to work ok I think. The main thing is to know what the name of the template is (as opposed to the name of the style).

e.g. on my test setup on J1.7, I used the following:

$mainframe =& JFactory::getApplication();
$template =& $mainframe->getTemplate();
echo $template;

It came up with:

beez_20

This template name corresponds to the "Template" column in the Styles manager (part of the template manager).

Does that work for you?

Cheers,
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
3319 Posts
User info in posts
Administrator has disabled public posting

Re: Module based on template

Well, actually, now I feel confused, I don't know what I had done, because yes, it is working... I suppose I misspelled my template name every time I tried because I retried after copying/pasting it from the code you gave me, and it is perfectly working.

I am sorry I made you waste your time on a problem that wasn't one...

Kind regards,

Guillaume

LaGriff
Beginner Modder
ranks
useravatar
Offline
5 Posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1674
Total Polls:
6
Total Posts:
5917
Total Posts Today:
5
User Info:
 
Total Users:
11536
Newest User:
lucero1247
Members Online:
4
Guests Online:
152


Forum Legend:

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