i know that i can set a module in joomla to go to a menu item, the seciton that my k2 is in. But that won't work. Becasue it puts that module code on all the k2 pages under it as well.. I just want to put the module onto the category main page only.
1. is this possible using a module liked to a menu item but not pages beneath that item?
2. can anyone give me the php code that i can insert into my joomla tempate (japurity) that will say
if this is the k2 category main page (k2-category1) do this, else do nothing.
I was thinking of possibly using this code to pull the cateogry block from the k2 area and put it into the joomla area????
<div class="itemListCategoriesBlock"> <?php if(isset($this->category) && ( $this->params->get('catImage') || $this->params->get('catTitle') || $this->params->get('catDescription') || $this->category->event->K2CategoryDisplay )): ?> <!-- Category block --> <div class="itemListCategory"> <?php if(isset($this->addLink)): ?> <!-- Item add link --> <span class="catItemAddLink"> <a class="modal" rel="{handler:'iframe',size:{x:990,y:650}}" href="<?php echo $this->addLink; ?>"> <?php echo JText::_('Add a new item in this category'); ?> </a> </span> <?php endif; ?> <?php if($this->params->get('catImage') && $this->category->image): ?> <!-- Category image --> <img alt="<?php echo $this->category->name; ?>" src="<?php echo $this->category->image; ?>" style="width:<?php echo $this->params->get('catImageWidth'); ?>px; height:auto;" /> <?php endif; ?> <?php if($this->params->get('catTitle')): ?> <!-- Category title --> <h2><?php echo $this->category->name; ?><?php if($this->params->get('catTitleItemCounter')) echo ' ('.$this->pagination->total.')'; ?></h2> <?php endif; ?> <?php if($this->params->get('catDescription')): ?> <!-- Category description --> <p><?php echo $this->category->description; ?></p> <?php endif; ?> <!-- K2 Plugins: K2CategoryDisplay --> <?php echo $this->category->event->K2CategoryDisplay; ?> <div class="clr"></div> </div> <?php endif; ?> <?php if($this->params->get('subCategories') && isset($this->subCategories) && count($this->subCategories)): ?> <!-- Subcategories --> <div class="itemListSubCategories"> <h3><?php echo JText::_('Children categories'); ?></h3> <?php foreach($this->subCategories as $key=>$subCategory): ?> <?php // Define a CSS class for the last container on each row if( (($key+1)%($this->params->get('subCatColumns'))==0) || count($this->subCategories)<$this->params->get('subCatColumns') ) $lastContainer= ' subCategoryContainerLast'; else $lastContainer=''; ?> <div class="subCategoryContainer<?php echo $lastContainer; ?>"<?php echo (count($this->subCategories)==1) ? '' : ' style="width:'.number_format(100/$this->params->get('subCatColumns'), 1).'%;"'; ?>> <div class="subCategory"> <?php if($this->params->get('subCatImage') && $subCategory->image): ?> <!-- Subcategory image --> <a class="subCategoryImage" href="<?php echo $subCategory->link; ?>"> <img alt="<?php echo $subCategory->name; ?>" src="<?php echo $subCategory->image; ?>" /> </a> <?php endif; ?> <?php if($this->params->get('subCatTitle')): ?> <!-- Subcategory title --> <h2> <a href="<?php echo $subCategory->link; ?>"> <?php echo $subCategory->name; ?><?php if($this->params->get('subCatTitleItemCounter')) echo ' ('.$subCategory->numOfItems.')'; ?> </a> </h2> <?php endif; ?> <?php if($this->params->get('subCatDescription')): ?> <!-- Subcategory description --> <p><?php echo $subCategory->description; ?></p> <?php endif; ?> <!-- Subcategory more... --> <a class="subCategoryMore" href="<?php echo $subCategory->link; ?>"> <?php echo JText::_('View items...'); ?> </a> <div class="clr"></div> </div> </div> <?php if(($key+1)%($this->params->get('subCatColumns'))==0): ?> <div class="clr"></div> <?php endif; ?> <?php endforeach; ?> <div class="clr"></div> </div> <?php endif; ?> </div>
1. is this possible using a module liked to a menu item but not pages beneath that item?
2. can anyone give me the php code that i can insert into my joomla tempate (japurity) that will say
if this is the k2 category main page (k2-category1) do this, else do nothing.
I was thinking of possibly using this code to pull the cateogry block from the k2 area and put it into the joomla area????
<div class="itemListCategoriesBlock"> <?php if(isset($this->category) && ( $this->params->get('catImage') || $this->params->get('catTitle') || $this->params->get('catDescription') || $this->category->event->K2CategoryDisplay )): ?> <!-- Category block --> <div class="itemListCategory"> <?php if(isset($this->addLink)): ?> <!-- Item add link --> <span class="catItemAddLink"> <a class="modal" rel="{handler:'iframe',size:{x:990,y:650}}" href="<?php echo $this->addLink; ?>"> <?php echo JText::_('Add a new item in this category'); ?> </a> </span> <?php endif; ?> <?php if($this->params->get('catImage') && $this->category->image): ?> <!-- Category image --> <img alt="<?php echo $this->category->name; ?>" src="<?php echo $this->category->image; ?>" style="width:<?php echo $this->params->get('catImageWidth'); ?>px; height:auto;" /> <?php endif; ?> <?php if($this->params->get('catTitle')): ?> <!-- Category title --> <h2><?php echo $this->category->name; ?><?php if($this->params->get('catTitleItemCounter')) echo ' ('.$this->pagination->total.')'; ?></h2> <?php endif; ?> <?php if($this->params->get('catDescription')): ?> <!-- Category description --> <p><?php echo $this->category->description; ?></p> <?php endif; ?> <!-- K2 Plugins: K2CategoryDisplay --> <?php echo $this->category->event->K2CategoryDisplay; ?> <div class="clr"></div> </div> <?php endif; ?> <?php if($this->params->get('subCategories') && isset($this->subCategories) && count($this->subCategories)): ?> <!-- Subcategories --> <div class="itemListSubCategories"> <h3><?php echo JText::_('Children categories'); ?></h3> <?php foreach($this->subCategories as $key=>$subCategory): ?> <?php // Define a CSS class for the last container on each row if( (($key+1)%($this->params->get('subCatColumns'))==0) || count($this->subCategories)<$this->params->get('subCatColumns') ) $lastContainer= ' subCategoryContainerLast'; else $lastContainer=''; ?> <div class="subCategoryContainer<?php echo $lastContainer; ?>"<?php echo (count($this->subCategories)==1) ? '' : ' style="width:'.number_format(100/$this->params->get('subCatColumns'), 1).'%;"'; ?>> <div class="subCategory"> <?php if($this->params->get('subCatImage') && $subCategory->image): ?> <!-- Subcategory image --> <a class="subCategoryImage" href="<?php echo $subCategory->link; ?>"> <img alt="<?php echo $subCategory->name; ?>" src="<?php echo $subCategory->image; ?>" /> </a> <?php endif; ?> <?php if($this->params->get('subCatTitle')): ?> <!-- Subcategory title --> <h2> <a href="<?php echo $subCategory->link; ?>"> <?php echo $subCategory->name; ?><?php if($this->params->get('subCatTitleItemCounter')) echo ' ('.$subCategory->numOfItems.')'; ?> </a> </h2> <?php endif; ?> <?php if($this->params->get('subCatDescription')): ?> <!-- Subcategory description --> <p><?php echo $subCategory->description; ?></p> <?php endif; ?> <!-- Subcategory more... --> <a class="subCategoryMore" href="<?php echo $subCategory->link; ?>"> <?php echo JText::_('View items...'); ?> </a> <div class="clr"></div> </div> </div> <?php if(($key+1)%($this->params->get('subCatColumns'))==0): ?> <div class="clr"></div> <?php endif; ?> <?php endforeach; ?> <div class="clr"></div> </div> <?php endif; ?> </div>