Adding a template parameter to your template

Rate this topic: Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.1.00 out of 6 based on 1 vote(s)
GK User
Mon Mar 27, 2017 3:26 pm
Reply with quote
Report this post
Hello,
I was trying to add an additional parameter to your template.

I modified templateDetails.xml adding one field with some options. It works and I see my field and options on administrator panel.

Now, I want to load a different css file based on parameter value.
I checked how actually is working $template_style = $this->getTemplateStyle('style'); in head.php, but I was not able to figure out how to check the parameter of my style in gavern.

Any help?

Kind regards,
Matt
User avatar
Fresh Boarder

Joshua M
Thu Mar 30, 2017 12:42 pm
Reply with quote
Report this post
Hi,

You can check it by using the following syntax:
Code: Select all
if ($this->API->get('template_filed_name', 'first') == 'first' ){
  // load your css file if the template_field_name is set to first option.
}
User avatar
Moderator


cron
Remember me
Register New Account
If you are old Gavick user, click HERE for steps to retrieve your account.