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.

 

Custom Layput for Articles ?

Custom Layput for Articles ?

Hi,

is ist possible to change the layout of an article item with Chameleon? Every content item can have its own layout in J!1.7

I hope i can change it on the fly with Chameleon.


best regards,
Markus

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

Re: Custom Layput for Articles ?

Hi Markus,

So far, this is unexplored territory smile This functionality is not built in to Chameleon, and I've had to look carefully inside Joomla to find some work-arounds.

Here's what I found:

1 - if the article is directly linked from a menu item, you can use this in the SUCCEED action in Chameleon to set the new layout. The layout is made of 2 parts: the template name and the name of the file with the alternative layout.

$app = JFactory::getApplication('site');
$active    = $app->getMenu()->getActive();
$active->query['layout'] = "beez_20:alternative";

2 - if the article is not directly linked from a menu item, then as far as I can see there is no way to do the override without hacking core Joomla. This is because the parameters for the item are taken fairly directly from the database, and I can't find any way to intercept these to insert a new parameter value.

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

Re: Custom Layput for Articles ?

Hi,

thank you for your fast answer. I wll take a closer look in the core.

best regards,
Markus

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

Board Info

Board Stats:
 
Total Topics:
1685
Total Polls:
6
Total Posts:
5940
Total Posts Today:
1
User Info:
 
Total Users:
5186
Newest User:
Totosite
Members Online:
0
Guests Online:
170

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