Welcome, Guest
Username: Password: Remember me

Building something on Astroid?

Submit your site to be featured in our monthly Astroid Site Showcase!

Submit Now

TOPIC: call param in override

call param in override 2 weeks 5 days ago #15883

  • serge
  • serge's Avatar
  • Offline
  • Senior Member
  • Posts: 69
  • Thank you received: 4
  • Karma: 0

I want to use template params in a blog view :

so I inserted this code for testing :
$app = JFactory::getApplication('site'); 
$template = $app->getTemplate(true);
$hn = $template->params->get('header_text_color', '');
<?php echo $hn; ?>

but it does not appear,
(header text color is just an exemple for test , because I would use my own param after)

where am I wrong ??
The administrator has disabled public write access.

call param in override 2 weeks 4 days ago #15892

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Posts: 2555
  • Thank you received: 390
  • Karma: 79
Hi Serge,

The above should just fine work but in case it isn't, try the below code that's used in one of the overrides.
See how overrides are done in the content overrides folder.


So the code would be
$template = new AstroidFrameworkTemplate(JFactory::getApplication()->getTemplate(true));
$template->params->get('header_text_color', '')

Thank You,
If you like our support and products, tweet us at joomdev and let the world know about it.
The administrator has disabled public write access.
Time to create page: 0.130 seconds

JD Builder - The Next Generation
Joomla Page Builder

Now Design any Layout with Drag and Drop Interface.