Keyword

Template variable question

  • Mike Economou
  • Mike Economou's Avatar Topic Author
  • Offline
  • Junior Member
More
10 years 4 weeks ago #131563 by Mike Economou
Template variable question was created by Mike Economou
Hi,
I need to use some module params in my template file.
So in k2 template file category.php I have this piece of code to get the params to an object :
Log in  or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
10 years 3 weeks ago #131564 by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: Template variable question
What functionality/options to you want your category/ category item have.

If you simple want to display a module you can paste the code in the category_item.php file.

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

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

  • Mike Economou
  • Mike Economou's Avatar Topic Author
  • Offline
  • Junior Member
More
10 years 3 weeks ago #131565 by Mike Economou
Replied by Mike Economou on topic Re: Template variable question
In my module I have a param that the user inputs, is called custom_class
the param is a text field containing a custom class for a span element

So I want to get this param once (that's why I put it in category.php)
and then in category-item.php I want it for every item like :
Log in  or Create an account to join the conversation.

More
10 years 3 weeks ago #131566 by Lefteris
Replied by Lefteris on topic Re: Template variable question
You can assign it to a variable in the view ( since it's in the same view ):
$this->mod_obj =  json_decode($modparams);

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

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

  • Mike Economou
  • Mike Economou's Avatar Topic Author
  • Offline
  • Junior Member
More
10 years 3 weeks ago #131567 by Mike Economou
Replied by Mike Economou on topic Re: Template variable question
kalispera,
thanx for the answer,
yes is the same view,
but in which file of the view I shoud assign my object ?

views/itemlist/tmpl/category.php ?
views/item/tmpl/item.php ?
something else ?

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