fbpx
Welcome, Guest
Username: Password: Remember me

You can build one page sites with Astroid

Did you know that you can build one page website web Astroid, without using any 3rd party extension

Watch the tutorial

TOPIC: call param in override

call param in override 6 months 3 weeks ago #15883

  • serge
  • serge's Avatar
  • Offline
  • Senior Member
  • Posts: 78
  • 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 6 months 3 weeks ago #15892

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Posts: 3164
  • Thank you received: 472
  • Karma: 86
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.254 seconds