Keyword

[SOLVED] Access Joomla Template Parameters from K2 Sub-Template

More
9 years 4 months ago #143830 by Mike
Hi, I'm using K2 for it's sub-templating functions which are very useful, I've also set up some native Joomla template parameters using this documentation .

I can get to them fine from within my main template files by using
$this->params->get('my_parameter_name', '');

but how can I access them from my K2 sub-template where $this refers to the K2 object and not my template object? Is there anyway to pass params from my main template to the sub template?

Many Thanks

Please Log in or Create an account to join the conversation.

More
9 years 4 months ago #143835 by Lefteris
Hi,

This is what you need :
JFactory::getApplication()->getTemplate(true)->params->get('my_parameter_name');

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

More
9 years 4 months ago #143839 by Mike
Perfect! Thanks for the rapid response

Please Log in or Create an account to join the conversation.

More
9 years 4 months ago #143858 by Lefteris
You are welcome.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum