fbpx
Introducing JD Builder - Now Beat the unbeatable designsDownload For Free
Welcome, Guest
Username: Password: Remember me

Need a new feature in Astroid?

Submit feature requests on github and help improve Astroid.

Submit Now

TOPIC: call param in override

call param in override 3 months 3 weeks ago #15883

  • serge
  • serge's Avatar
  • Offline
  • Senior Member
  • Posts: 73
  • Thank you received: 5
  • Karma: 0
hello

I want to use template params in a blog view :
\templates\astroid_template_zero\html\com_content\category\blog.php

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 3 months 3 weeks ago #15892

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Posts: 2965
  • Thank you received: 449
  • Karma: 94
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.

github.com/joomdev/Astroid-Framework/blo...icle/default.php#L21

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

Thanks,
Chetan
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.
Moderators: chandandeep
Time to create page: 0.216 seconds