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?
13 years 3 months ago #115741
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.
Topic Author
13 years 3 months ago #115742
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...
13 years 3 months ago #115743
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.