I like the way it is the template publisher.
now my code from file com_k2/categoy_item in this way
- Code: Select all
<?php echo $this->item->event->AfterDisplayTitle; ?>
<?php echo $this->item->event->K2AfterDisplayTitle; ?>
<aside>
<?php if($this->item->params->get('catItemDateCreated')): ?>
<time datetime="<?php echo JHtml::_('date', $this->item->created, 'Y-m-d'); ?>">
<?php echo JHTML::_('date', $this->item->created, JText::_('d M')); ?>
</time>
<?php endif; ?>
<ul>
<?php if($this->item->params->get('catItemCategory')): ?>
<li class="itemCategory"> <span><?php echo JText::_('K2_PUBLISHED_IN'); ?></span> <a href="<?php echo $this->item->category->link; ?>"><?php echo $this->item->category->name; ?></a> </li>
<?php endif; ?>
<?php if($this->item->params->get('catItemAuthor')): ?>
<li class="itemAuthor"> <?php echo K2HelperUtilities::writtenBy($this->item->author->profile->gender); ?>
<?php if(isset($this->item->author->link) && $this->item->author->link): ?>
<a rel="author" href="<?php echo $this->item->author->link; ?>"><?php echo $this->item->author->name; ?></a>
<?php else: ?>
<?php echo $this->item->author->name; ?>
<?php endif; ?> </li>
<?php endif; ?>
<?php if($this->item->params->get('catItemCommentsAnchor')): ?>
<li class="itemComments">
<?php if(!empty($this->item->event->K2CommentsCounter)): ?>
<!-- K2 Plugins: K2CommentsCounter -->
<?php echo $this->item->event->K2CommentsCounter; ?>
<?php else: ?>
<?php if($this->item->numOfComments > 0): ?>
<a href="<?php echo $this->item->link; ?>#itemCommentsAnchor">
<?php echo $this->item->numOfComments; ?> <?php echo ($this->item->numOfComments>1) ? JText::_('K2_COMMENTS') : JText::_('K2_COMMENT'); ?>
</a>
<?php else: ?>
<a href="<?php echo $this->item->link; ?>#itemCommentsAnchor">
<?php echo JText::_('K2_BE_THE_FIRST_TO_COMMENT'); ?>
</a>
<?php endif; ?>
<?php endif; ?>
</li>
<?php endif; ?>
<?php if($this->item->params->get('catItemRating')): ?>
<li class="itemRatingBlock"> <span><?php echo JText::_('K2_RATE_THIS_ITEM'); ?></span>
<div class="itemRatingForm">
<ul class="itemRatingList">
<li class="itemCurrentRating" id="itemCurrentRating<?php echo $this->item->id; ?>" style="width:<?php echo $this->item->votingPercentage; ?>%;"></li>
<li><a href="#" rel="<?php echo $this->item->id; ?>" title="<?php echo JText::_('K2_1_STAR_OUT_OF_5'); ?>" class="one-star">1</a></li>
<li><a href="#" rel="<?php echo $this->item->id; ?>" title="<?php echo JText::_('K2_2_STARS_OUT_OF_5'); ?>" class="two-stars">2</a></li>
<li><a href="#" rel="<?php echo $this->item->id; ?>" title="<?php echo JText::_('K2_3_STARS_OUT_OF_5'); ?>" class="three-stars">3</a></li>
<li><a href="#" rel="<?php echo $this->item->id; ?>" title="<?php echo JText::_('K2_4_STARS_OUT_OF_5'); ?>" class="four-stars">4</a></li>
<li><a href="#" rel="<?php echo $this->item->id; ?>" title="<?php echo JText::_('K2_5_STARS_OUT_OF_5'); ?>" class="five-stars">5</a></li>
</ul>
<div id="itemRatingLog<?php echo $this->item->id; ?>" class="itemRatingLog"><?php echo $this->item->numOfvotes; ?></div>
</div>
</li>
<?php endif; ?>
<?php if($this->item->params->get('catItemHits')): ?>
<li class="itemHitsBlock"> <span class="itemHits"><?php echo JText::_('K2_READ'); ?>: <?php echo $this->item->hits; ?> <?php echo JText::_('K2_TIMES'); ?></span> </li>
<?php endif; ?>
<?php if($this->item->params->get('catItemDateModified') && $this->item->created != $this->item->modified): ?>
<li class="itemDateModified"> <?php echo JText::_('K2_LAST_MODIFIED_ON'); ?> <?php echo JHTML::_('date', $this->item->modified, JText::_('K2_DATE_FORMAT_LC2')); ?> </li>
<?php endif; ?>
<?php if($this->item->params->get('latestItemDateCreated')): ?>
<li class="itemDate">
<?php echo JHTML::_('date', $this->item->created, JText::_('d M')); ?>
</li>
<?php endif; ?>
</ul>
</aside>
see attach