- Posts: 32
COMMUNITY FORUM
Template variable question
- Mike Economou
-
Topic Author
- Offline
- Junior Member
Less
More
10 years 8 months 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 :
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
-
- Offline
- Platinum Member
Less
More
- Posts: 15920
10 years 8 months 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.
If you simple want to display a module you can paste the code in the category_item.php file.
Please Log in or Create an account to join the conversation.
- Mike Economou
-
Topic Author
- Offline
- Junior Member
Less
More
- Posts: 32
10 years 8 months 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 :
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.
- Lefteris
-
- Offline
- Platinum Member
Less
More
- Posts: 8743
10 years 8 months 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);
Please Log in or Create an account to join the conversation.
- Mike Economou
-
Topic Author
- Offline
- Junior Member
Less
More
- Posts: 32
10 years 8 months 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 ?
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.