- Posts: 4
COMMUNITY FORUM
Reqeust per category
- Mick Nojgan
- Topic Author
- Offline
- New Member
Less
More
11 years 2 months ago #115740
by Mick Nojgan
Reqeust per category was created by Mick Nojgan
Hi,
i'm new to K2, can i outside from K2 code make a if request for a category, for example for category alias?
i'm new to K2, can i outside from K2 code make a if request for a category, for example for category alias?
Log in or Create an account to join the conversation.
- Krikor Boghossian
- Offline
- Platinum Member
Less
More
- Posts: 15920
11 years 2 months ago #115741
by Krikor Boghossian
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by Krikor Boghossian on topic Re: Reqeust per category
Hello Mick,
The varies depending on where you use it. I can be $this->item or $item or it can be more complicated.
You have to be a bit more precise on what you want to do so I can point you to the optimal solution.
The varies depending on where you use it. I can be $this->item or $item or it can be more complicated.
You have to be a bit more precise on what you want to do so I can point you to the optimal solution.
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Mick Nojgan
- Topic Author
- Offline
- New Member
Less
More
- Posts: 4
11 years 2 months ago #115742
by Mick Nojgan
Replied by Mick Nojgan on topic Re: Reqeust per category
Hi Krikor,
i need outside of K2 content a Button in Head part of my website, a can't create module because i can not setup this button only on Item(Preview) page, and also only for this category, i need this button for my category "Services" and on preview page...
i need outside of K2 content a Button in Head part of my website, a can't create module because i can not setup this button only on Item(Preview) page, and also only for this category, i need this button for my category "Services" and on preview page...
Please Log in or Create an account to join the conversation.
- Lefteris
- Offline
- Moderator
Less
More
- Posts: 8743
11 years 2 months ago - 11 years 2 months ago #115743
by Lefteris
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by Lefteris on topic Re: Reqeust per category
You can use a module and handle in which case it will show with an if statement through your index.php in your template.
For example, you say you need this button showing to a specific category's (which has a menu item leading to it) item page.
First define these two variables. Check first if they are defined already somewhere else.
Then add the module position
This will show the module only to this category's items.
For example, you say you need this button showing to a specific category's (which has a menu item leading to it) item page.
First define these two variables. Check first if they are defined already somewhere else.
$view = JRequest::getCmd('view');
$itemid = JRequest::getInt('Itemid');
Then add the module position
<?php if($this->countModules('MODULE_NAME') && ($view=='item') && ($itemid=='YOUR_CATEGORY'S_ITEMID')): ?>
<jdoc:include type="modules" name="MODULE_NAME" style="xhtml" />
<?php endif; ?>
This will show the module only to this category's items.
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.