k2 extra fields move on top

Support desk for Multipurpose Quark Theme
GK User
Sun Nov 22, 2015 6:52 am
Sample page is this: http://v-boge.org/news/item/3530-seminar-dengi-po-biblejski-v-gorode-sankt-peterburg-4-6-dekabrya-2015-goda
Extra fields at the bottom. Though I need it to be on top. I've created additional template folder components/com_k2/templates/seminars/ and in item.php moved extrafileds code so it look this way:
Code: Select all
 <div class="itemBody">

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

          <?php if($this->item->params->get('itemExtraFields') && count($this->item->extra_fields)): ?>
     <!-- Item extra fields -->
     <div class="itemExtraFields">
        <h3><?php echo JText::_('K2_ADDITIONAL_INFO'); ?></h3>
        <ul>
         <?php foreach ($this->item->extra_fields as $key=>$extraField): ?>
         <?php if($extraField->value != ''): ?>
         <li class="<?php echo ($key%2) ? "odd" : "even"; ?> type<?php echo ucfirst($extraField->type); ?> group<?php echo $extraField->group; ?>">
            <?php if($extraField->type == 'header'): ?>
            <h4 class="itemExtraFieldsHeader"><?php echo $extraField->name; ?></h4>
            <?php else: ?>
            <span class="itemExtraFieldsLabel"><?php echo $extraField->name; ?>:</span>
            <span class="itemExtraFieldsValue"><?php echo $extraField->value; ?></span>
            <?php endif; ?>
         </li>
         <?php endif; ?>
         <?php endforeach; ?>
         </ul>
       <div class="clr"></div>
     </div>
     <?php endif; ?>

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

When I asign "seminars" k2 layout template to this category, I see extra fields move on top, yet the Quark template doesn't work any more. What else do I need to do to make it work, so that everything is according to the Quark template yet extra fields are before the main text? Please help.
User avatar
Platinum Boarder

teitbite
Mon Nov 23, 2015 4:56 pm
Hi

What You did is correct, but You need to use the file which has already been modified for this template, which is located /html/com_k2/templates/default/item.php
User avatar
Moderator

GK User
Wed Nov 25, 2015 6:49 pm
teitbite wrote:Hi

What You did is correct, but You need to use the file which has already been modified for this template, which is located /html/com_k2/templates/default/item.php

If I do that, it will change the layout for all article pages. I need to do this only for one category of k2 articles. I thought I would keep your k2-template for the whole site, and would add mine for one category only and would turn it on in that k2category settings... https://yadi.sk/i/OBdnQwzekjSLW That's why I added another folder - to create new k2-template while keeping Quark template. Like you have different layouts for first Quark and Restaurant, so I wanted to add the third one. )))
User avatar
Platinum Boarder

teitbite
Sat Nov 28, 2015 12:12 pm
Hi

That's exactly what I said :) I only need You to use a copy of /html/com_k2/templates/default/item.php file in Your newly added folder so it can be still using most of the style from default template and make this change to this copied file.
User avatar
Moderator


cron