- Posts: 3
COMMUNITY FORUM
[SOLVED] Κ2 template variable
- Panagiotis Halatsakos
- Topic Author
- Offline
- New Member
Less
More
9 years 2 months ago #141125
by Panagiotis Halatsakos
Κ2 template variable was created by Panagiotis Halatsakos
I am building a website using warp 7 / yootheme master theme, with K2 as content manager.
Warp 7 theme controls the way your output is presented using menu items. I have created two menu items for my theme attached to the K2 categories special offers and news, one with a K2 category-as-a-grid template (k2grid - news) and one with a K2 category-as-a-list (k2list - special offers) template, which are in templates/yoo_master2/html/com_k2/k2grid and templates/.../com_k2/k2list .
The problem is that in some cases I want to show a sidebar position that is defined to warp 7, and in some others I don't want to do that. I would filter the view to see if it's a K2 item or itemlist and my problem would be fixed, but I also want to filter it depending the template value, before it's being rendered on the view (using themes.config.php of warp 7 theme).
How can I get the value of the template used for the category, the one that is defined on K2 > categories > Category Item Layout (template) in PHP?
Warp 7 theme controls the way your output is presented using menu items. I have created two menu items for my theme attached to the K2 categories special offers and news, one with a K2 category-as-a-grid template (k2grid - news) and one with a K2 category-as-a-list (k2list - special offers) template, which are in templates/yoo_master2/html/com_k2/k2grid and templates/.../com_k2/k2list .
The problem is that in some cases I want to show a sidebar position that is defined to warp 7, and in some others I don't want to do that. I would filter the view to see if it's a K2 item or itemlist and my problem would be fixed, but I also want to filter it depending the template value, before it's being rendered on the view (using themes.config.php of warp 7 theme).
How can I get the value of the template used for the category, the one that is defined on K2 > categories > Category Item Layout (template) in PHP?
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
- Offline
- Platinum Member
Less
More
- Posts: 15920
9 years 2 months ago #141143
by Krikor Boghossian
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by Krikor Boghossian on topic Κ2 template variable
Since I do not know how the template has been built I would suggest that you used the "Modules Anywhere" extension.
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Panagiotis Halatsakos
- Topic Author
- Offline
- New Member
Less
More
- Posts: 3
9 years 2 months ago #141148
by Panagiotis Halatsakos
Replied by Panagiotis Halatsakos on topic Κ2 template variable
Hi,
my question is mostly on the programming level of K2, what I want is to know how to distinct the category sub-template and the view type.
I know that the view type can be acquired by using the following code:
$app = JFactory::getApplication();
$view = $app->input->get('view'); // will return item or itemview depending on the category or item being viewed
I want something similar to return the template variable of the category, the one defined in:
K2 > CATEGORY (Edit / New) > Category Item Layout, *template
my question is mostly on the programming level of K2, what I want is to know how to distinct the category sub-template and the view type.
I know that the view type can be acquired by using the following code:
$app = JFactory::getApplication();
$view = $app->input->get('view'); // will return item or itemview depending on the category or item being viewed
I want something similar to return the template variable of the category, the one defined in:
K2 > CATEGORY (Edit / New) > Category Item Layout, *template
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
- Offline
- Platinum Member
Less
More
- Posts: 15920
9 years 2 months ago #141153
by Krikor Boghossian
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by Krikor Boghossian on topic Κ2 template variable
You could set a variable on the template and display different elements depending if you are on K2, com_contact, another menu item or a K2 item etc..
Since you know your way around coding, download Takai - www.joomlaworks.net/joomla-templates/free-templates/takai - which is free and open the /includes/helper.php file. You will find a really usefull cheatsheet (top 30 lines) there which will help you structure your code.
Since you know your way around coding, download Takai - www.joomlaworks.net/joomla-templates/free-templates/takai - which is free and open the /includes/helper.php file. You will find a really usefull cheatsheet (top 30 lines) there which will help you structure your code.
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- K2 For Yootheme Users
- Offline
- New Member
Less
More
- Posts: 7
8 years 6 months ago #148282
by K2 For Yootheme Users
Replied by K2 For Yootheme Users on topic Κ2 template variable
Please have a look at www.k2foruikit.com/
Its a K2 theme that is built for Yootheme templates. It will fix all css problem with yootheme templates.
Thanks
Its a K2 theme that is built for Yootheme templates. It will fix all css problem with yootheme templates.
Thanks
Please Log in or Create an account to join the conversation.