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.

 

Template Styles

Template Styles

Joomla v1.7.3 Metamod v3.7

I've followed this:
http://www.metamodpro.com/metamod/recip … a-template

to get a module to display for a particular template, but in Joomla 1.7 it has styles and I need to get the name of the style not the base template.
Does anyone know the PHP to get the style name?

Paul

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

Re: Template Styles

Ugh, no I don't know if that's possible sad

Joomla 1.7 made it difficult to retrieve that information. I don't think it's even held as a style in its own right... but instead as a set of parameters for that style.

However, if you're using standard Joomla allocation of a style to a menu item, you can retrieve the style that is supposed to be allocated to that menu item (providing no other plugins have changed it).

Does that sound like it might work for you? If so, I'll give you a database query to retrieve it for the current Itemid (a.k.a. menu item).

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: Template Styles

I found a different way of doing it. The template (from http://www.youjoomla.com/) allows me to specify the menu so each style has a different menu displayed. Then I used this code, which works for me :-)

$menu =& JSite::getMenu();
if ($menu->getActive()->menutype == 'mainmenu')
{
  return 90;
}
else
{
  return 92;
}

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

Re: Template Styles

Aha, that's a great work-around. Well done.

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

Board Info

Board Stats:
 
Total Topics:
1675
Total Polls:
6
Total Posts:
5917
Posts this week:
6
User Info:
 
Total Users:
11570
Newest User:
moises1247
Members Online:
1
Guests Online:
203

Online: 
moises1247

Forum Legend:

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