Moving K2 article title from header to article

Support desk for Multipurpose Quark Theme
GK User
Tue Mar 29, 2016 7:37 pm
Hi,
How would I go about moving the K2 article title from the header, as shown here in the demo:
Image
to the article, as shown here:
Image
I'd also like to move the article picture to the right side of the article.
Thanks for any help.
User avatar
Senior Boarder

teitbite
Sat Apr 02, 2016 3:19 pm
Hi

You have to edit file /html/com_k2/templates/default/item.php and remove code:

Code: Select all
     <?php if(
        !$document->countModules('header') &&
        (
           !empty($this->item->image) ||
           $params->get('itemTitle') ||
           $this->item->params->get('itemDateCreated')
        )
     ): ?>
     <div class="header <?php if(!($params->get('itemImage') && !empty($this->item->image))): ?> no-image<?php endif; ?>">
          <?php if(!empty($this->item->image)) : ?>
          <img src="<?php echo $this->item->image; ?>" alt="<?php echo K2HelperUtilities::cleanHtml($this->item->title); ?>" />
          <?php endif; ?>
          <?php if($params->get('itemTitle')): ?>
          <div class="item-title-wrap">
               <h1 class="item-title" data-sr="enter bottom and move 50px">
                  <?php echo $this->item->title; ?>
                  <?php if($params->get('itemFeaturedNotice') && $this->item->featured): ?>
                  <sup><i class="gkicon-star"></i></sup>
                  <?php endif; ?>
               </h1>
               
               <?php if($this->item->params->get('itemDateCreated')): ?>
               <span class="item-category" data-sr="enter bottom and move 50px and wait .2s">
                     <time datetime="<?php echo JHtml::_('date', $this->item->created, JText::_(DATE_W3C)); ?>"> <?php echo JHTML::_('date', $this->item->created, 'l, j F Y'); ?> </time>
               </span>
               <?php endif; ?>
          </div>
          <?php endif; ?>
       
          <?php if(
                  ($params->get('itemImageMainCaption') && !empty($this->item->image_caption)) ||
                  ($params->get('itemImageMainCredits') && !empty($this->item->image_credits))
               ): ?>
          <div class="item-image-info">
               <?php if($params->get('itemImageMainCaption') && !empty($this->item->image_caption)): ?>
               <span class="item-image-caption"><?php echo $this->item->image_caption; ?></span>
               <?php endif; ?>
               <?php if($params->get('itemImageMainCredits') && !empty($this->item->image_credits)): ?>
               <span class="item-image-credits"><?php echo $this->item->image_credits; ?></span>
               <?php endif; ?>
          </div>
          <?php endif; ?>
         
          <?php if($templateParams->get('display_mouse_icon', '1') != '0') : ?>
          <span class="mouse-icon"><span><span></span></span></span>
          <?php endif; ?>
     </div>
     <?php endif; ?>


than right after line:

Code: Select all
           <div class="item-content">


add this code:

Code: Select all
          <?php if($params->get('itemTitle')): ?>
          <div class="item-title-wrap">
               <h1 class="item-title" data-sr="enter bottom and move 50px">
                  <?php echo $this->item->title; ?>
                  <?php if($params->get('itemFeaturedNotice') && $this->item->featured): ?>
                  <sup><i class="gkicon-star"></i></sup>
                  <?php endif; ?>
               </h1>
               
               <?php if($this->item->params->get('itemDateCreated')): ?>
               <span class="item-category" data-sr="enter bottom and move 50px and wait .2s">
                     <time datetime="<?php echo JHtml::_('date', $this->item->created, JText::_(DATE_W3C)); ?>"> <?php echo JHTML::_('date', $this->item->created, 'l, j F Y'); ?> </time>
               </span>
               <?php endif; ?>
          </div>
          <?php endif; ?>

          <?php if(!empty($this->item->image)) : ?>
          <img src="<?php echo $this->item->image; ?>" alt="<?php echo K2HelperUtilities::cleanHtml($this->item->title); ?>" />
          <?php endif; ?>

          <?php if(
                  ($params->get('itemImageMainCaption') && !empty($this->item->image_caption)) ||
                  ($params->get('itemImageMainCredits') && !empty($this->item->image_credits))
               ): ?>
          <div class="item-image-info">
               <?php if($params->get('itemImageMainCaption') && !empty($this->item->image_caption)): ?>
               <span class="item-image-caption"><?php echo $this->item->image_caption; ?></span>
               <?php endif; ?>
               <?php if($params->get('itemImageMainCredits') && !empty($this->item->image_credits)): ?>
               <span class="item-image-credits"><?php echo $this->item->image_credits; ?></span>
               <?php endif; ?>
          </div>
          <?php endif; ?>
User avatar
Moderator

GK User
Fri Apr 08, 2016 11:20 am
Thanks, that worked. Had to hide the image display in the code though, since it was displayed despite changing it in K2 settings.
Could you also provide the same treatment for regular Joomla articles?
User avatar
Senior Boarder

GK User
Wed Apr 20, 2016 6:45 pm
It's been almost two weeks. Do you have anything on regular Joomla articles yet?
User avatar
Senior Boarder

teitbite
Sun Apr 24, 2016 6:24 pm
Hi

Sorry, didn't know You were looking for a solution to regular joomla articles as well.

Edit file: /html/com_content/article/default.php and remove code:

Code: Select all
   <?php if (
      !$document->countModules('header') &&
      (
         !$no_image ||
         $params->get('show_title') ||
         $params->get('show_publish_date') ||
         $params->get('show_create_date')
      )
   ) : ?>
   <div class="header<?php if($no_image) : ?> no-image<?php endif; ?>">
      <?php if (isset($images->image_fulltext) && !empty($images->image_fulltext)) : ?>
      <img src="<?php echo $images->image_fulltext; ?>" alt="" />
      <?php endif; ?>   
      
      <?php if (
         $params->get('show_title') ||
         $params->get('show_publish_date') ||
         $params->get('show_create_date')
      ) : ?>
      <div class="item-title-wrap">
         <?php if ($params->get('show_title')) : ?>
         <h1 class="item-title" itemprop="name" data-sr="enter bottom and move 50px"><?php echo $this->escape($this->item->title); ?></h1>
         <?php endif; ?>
         
         <?php if($params->get('show_publish_date')) : ?>
         <span class="item-category" data-sr="enter bottom and move 50px and wait .2s">
            <time datetime="<?php echo JHtml::_('date', $this->item->publish_up, JText::_(DATE_W3C)); ?>" itemprop="datePublished">
               <?php echo JHTML::_('date', $this->item->publish_up, 'l, j F Y'); ?>
            </time>
         </span>
         <?php elseif($params->get('show_create_date')) : ?>
         <span class="item-category" data-sr="enter bottom and move 50px and wait .2s">
            <time datetime="<?php echo JHtml::_('date', $this->item->created, JText::_(DATE_W3C)); ?>" itemprop="dateCreated">
               <?php echo JHTML::_('date', $this->item->created, 'l, j F Y'); ?>
            </time>
         </span>
         <?php endif; ?>
      </div>
      <?php endif; ?>
      
      <?php if($templateSettings->get('display_mouse_icon', '1') != '0') : ?>
      <span class="mouse-icon"><span><span></span></span></span>
      <?php endif; ?>
   </div>
   <?php endif; ?>


than copy this:

Code: Select all
      <?php if (
         $params->get('show_title') ||
         $params->get('show_publish_date') ||
         $params->get('show_create_date')
      ) : ?>
      <div class="item-title-wrap">
         <?php if ($params->get('show_title')) : ?>
         <h1 class="item-title" itemprop="name" data-sr="enter bottom and move 50px"><?php echo $this->escape($this->item->title); ?></h1>
         <?php endif; ?>
         
         <?php if($params->get('show_publish_date')) : ?>
         <span class="item-category" data-sr="enter bottom and move 50px and wait .2s">
            <time datetime="<?php echo JHtml::_('date', $this->item->publish_up, JText::_(DATE_W3C)); ?>" itemprop="datePublished">
               <?php echo JHTML::_('date', $this->item->publish_up, 'l, j F Y'); ?>
            </time>
         </span>
         <?php elseif($params->get('show_create_date')) : ?>
         <span class="item-category" data-sr="enter bottom and move 50px and wait .2s">
            <time datetime="<?php echo JHtml::_('date', $this->item->created, JText::_(DATE_W3C)); ?>" itemprop="dateCreated">
               <?php echo JHTML::_('date', $this->item->created, 'l, j F Y'); ?>
            </time>
         </span>
         <?php endif; ?>
      </div>
      <?php endif; ?>


under:

Code: Select all
           <div class="item-content">
User avatar
Moderator

GK User
Mon Apr 25, 2016 1:29 pm
That solves it.
Thanks for your help.
User avatar
Senior Boarder

teitbite
Tue Apr 26, 2016 1:32 pm
Hi
Glad I could help.
---
If You were satisfied with our support please let other users know on Twitter: http://twitter.com/gavickpro or Facebook: http://www.facebook.com/gavickpro
User avatar
Moderator


cron