Move the K2 author module in template

GK User
Mon Mar 19, 2012 8:20 pm
Hi there, working with boutique 2.5.

I am looking for a way to bring up the author module that comes on every K2 item pages. I would like to bring it above the header of the item.

The module block is called "itemAuthorBlock" and the file I have tried to patch is in /components/com_k2/templates/default. It doesn't seem to have any effect at all on the template when I bring this code up or if I try to duplicate it. There must be another file to patch.

From file "item.php" line 390
Code: Select all
<?php endif; ?>

  <?php if($this->item->params->get('itemAuthorBlock') && empty($this->item->created_by_alias)): ?>
  <!-- Author Block -->
  <div class="itemAuthorBlock">

     <?php if($this->item->params->get('itemAuthorImage') && !empty($this->item->author->avatar)): ?>
     <img class="itemAuthorAvatar" src="<?php echo $this->item->author->avatar; ?>" alt="<?php echo K2HelperUtilities::cleanHtml($this->item->author->name); ?>" />
     <?php endif; ?>

    <div class="itemAuthorDetails">
      <h3 class="itemAuthorName">
         <a rel="author" href="<?php echo $this->item->author->link; ?>"><?php echo $this->item->author->name; ?></a>
      </h3>

      <?php if($this->item->params->get('itemAuthorDescription') && !empty($this->item->author->profile->description)): ?>
      <p><?php echo $this->item->author->profile->description; ?></p>
      <?php endif; ?>

      <?php if($this->item->params->get('itemAuthorURL') && !empty($this->item->author->profile->url)): ?>
      <span class="itemAuthorUrl"><?php echo JText::_('K2_WEBSITE'); ?> <a rel="me" href="<?php echo $this->item->author->profile->url; ?>" target="_blank"><?php echo str_replace('http://','',$this->item->author->profile->url); ?></a></span>
      <?php endif; ?>

      <?php if($this->item->params->get('itemAuthorEmail')): ?>
      <span class="itemAuthorEmail"><?php echo JText::_('K2_EMAIL'); ?> <?php echo JHTML::_('Email.cloak', $this->item->author->email); ?></span>
      <?php endif; ?>

         <div class="clr"></div>

         <!-- K2 Plugins: K2UserDisplay -->
         <?php echo $this->item->event->K2UserDisplay; ?>

    </div>
    <div class="clr"></div>
  </div>


Cheers.
User avatar
Platinum Boarder

teitbite
Tue Mar 20, 2012 7:20 am
Hi

You got a good idea, but You are looking in a wrong place. Please edit file which is placed in template's /html/com_k2/default/item.php
User avatar
Moderator

GK User
Tue Mar 20, 2012 11:25 am
teitbite wrote:Hi

You got a good idea, but You are looking in a wrong place. Please edit file which is placed in template's /html/com_k2/default/item.php


That solved it! Cheers.
User avatar
Platinum Boarder

teitbite
Wed Mar 21, 2012 9:06 am
Hi

Glad I could help.
User avatar
Moderator


cron