K2 - NO IMAGE IN HEADER BUT IN ARTICLE

Support desk for Multipurpose Quark Theme
GK User
Fri Jun 17, 2016 2:11 pm
On my website w www.dagmarwienke.de w I have a kind of blog. It is under the menu "Notizen". I use the theme "Quark" and K2 for the blog (under menu "Notizen") and the articles (under the menu „Texte"). m http://www.dagmarwienke.de/blog.html m und m http://www.dagmarwienke.de/texte.html m

When you click on a listed article the link opens the article. So far so good. Like here: m http://www.dagmarwienke.de/blog/item/43 ... erter.html m
The image ist placed in the header and that is what I don't like. In K2, I think, you can't choose to have a header or not, only when you use the article function in joomla.

I would like to have the image not in the header, but in the content of the article like on the blog page of the them „Creativity" from Gavickpro" m https://demo.gavick.com/joomla25/creati ... -user-page m .
Is that possible to modify the theme quark for both the articles in „Notizen” and in „Texte" in that way?

With kind regards
Dagmar
User avatar
Fresh Boarder

teitbite
Mon Jun 20, 2016 8:58 pm
Hi

This is how it was designed for this template, so to get rid of this functionality please rename /html/com_k2/templates/default/item.php to /html/com_k2/templates/default/_item.php
User avatar
Moderator

GK User
Mon Jul 11, 2016 2:24 pm
If I do this, the Modules in the sidebar are also gone.
User avatar
Fresh Boarder

GK User
Mon Jul 11, 2016 4:43 pm
P.S.: And if I put an image in the article and not in the tab Images the image is not showing up because of Failed to load resource.
User avatar
Fresh Boarder

teitbite
Wed Jul 13, 2016 4:49 pm
Hi

In that case 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; ?>


from /html/com_k2/templates/default/item.php and add code:

Code: Select all
   <div class="itemHeader">

      <?php if($this->item->params->get('itemDateCreated')): ?>
      <!-- Date created -->
      <span class="itemDateCreated">
         <?php echo JHTML::_('date', $this->item->created , JText::_('K2_DATE_FORMAT_LC2')); ?>
      </span>
      <?php endif; ?>

     <?php if($this->item->params->get('itemTitle')): ?>
     <!-- Item title -->
     <h2 class="itemTitle">
         <?php if(isset($this->item->editLink)): ?>
         <!-- Item edit link -->
         <span class="itemEditLink">
            <a class="modal" rel="{handler:'iframe',size:{x:990,y:550}}" href="<?php echo $this->item->editLink; ?>">
               <?php echo JText::_('K2_EDIT_ITEM'); ?>
            </a>
         </span>
         <?php endif; ?>

        <?php echo $this->item->title; ?>

        <?php if($this->item->params->get('itemFeaturedNotice') && $this->item->featured): ?>
        <!-- Featured flag -->
        <span>
           <sup>
              <?php echo JText::_('K2_FEATURED'); ?>
           </sup>
        </span>
        <?php endif; ?>

     </h2>
     <?php endif; ?>

      <?php if($this->item->params->get('itemAuthor')): ?>
      <!-- Item Author -->
      <span class="itemAuthor">
         <?php echo K2HelperUtilities::writtenBy($this->item->author->profile->gender); ?>&nbsp;
         <?php if(empty($this->item->created_by_alias)): ?>
         <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; ?>
      </span>
      <?php endif; ?>

  </div>

     <?php if($this->item->params->get('itemImage') && !empty($this->item->image)): ?>
     <!-- Item Image -->
     <div class="itemImageBlock">
        <span class="itemImage">
           <a class="modal" rel="{handler: 'image'}" href="<?php echo $this->item->imageXLarge; ?>" title="<?php echo JText::_('K2_CLICK_TO_PREVIEW_IMAGE'); ?>">
              <img src="<?php echo $this->item->image; ?>" alt="<?php if(!empty($this->item->image_caption)) echo K2HelperUtilities::cleanHtml($this->item->image_caption); else echo K2HelperUtilities::cleanHtml($this->item->title); ?>" style="width:<?php echo $this->item->imageWidth; ?>px; height:auto;" />
           </a>
        </span>

        <?php if($this->item->params->get('itemImageMainCaption') && !empty($this->item->image_caption)): ?>
        <!-- Image caption -->
        <span class="itemImageCaption"><?php echo $this->item->image_caption; ?></span>
        <?php endif; ?>

        <?php if($this->item->params->get('itemImageMainCredits') && !empty($this->item->image_credits)): ?>
        <!-- Image credits -->
        <span class="itemImageCredits"><?php echo $this->item->image_credits; ?></span>
        <?php endif; ?>

        <div class="clr"></div>
     </div>
     <?php endif; ?>




before line:

Code: Select all
                <div class="item-body"> <?php echo $this->item->event->BeforeDisplayContent; ?> <?php echo $this->item->event->K2BeforeDisplayContent; ?>

User avatar
Moderator


cron