Joomla 2.5, Accessing template parameters in component's template
Asked Answered
C

1

9

What is the correct way to access template parameters in components template in Joomla 2.5?

There are something implementations for earlier versions of Joomla but not for 2.5. http://forum.joomla.org/viewtopic.php?p=2166990#p2166903

Coir answered 15/7, 2012 at 15:30 Comment(0)
A
18

I think this might be what you're looking for:

$app        = JFactory::getApplication();
$template   = $app->getTemplate(true);
$params     = $template->params;
$variable   = $params->get('variable');
Albino answered 15/7, 2012 at 15:43 Comment(1)
Just a note here that $template seems to be used elsewhere as a variable and so causes an error. Replace that with a different name and this still works in the latest Joomla.Stereoisomerism

© 2022 - 2024 — McMap. All rights reserved.