Detail page for Tags

Rate this topic: Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.1.00 out of 6 based on 1 vote(s)
GK User
Tue Sep 30, 2014 9:25 pm
Reply with quote
Report this post
When I click a tag from the tags module (sidebar) ... how can I get the details page to inherit one of the layouts of the K2 Categories.

Here is the current layout (when I click a tag):
http://www.forecaststore.com/2014/fashi ... g/cardigan

But I want the detail page to follow one of the other K2 Categories, like here:
http://www.forecaststore.com/2014/fashi ... /cp-shades

I tried changing the default parameters of the K2 Categories, but that did not affect the layout.

Thanks
User avatar
Fresh Boarder

teitbite
Thu Oct 02, 2014 8:46 am
Reply with quote
Report this post
Hi

This link http://www.forecaststore.com/2014/fashi ... g/cardigan shows 404 error, so I cannot tell which layout You have in mind. BUT take a look inside template's /html/com_k2 folder. You will find layouts for every ocassion. try copy the /category/default.php into tag.php . This way You should use same code for both layouts.
User avatar
Moderator

GK User
Thu Oct 02, 2014 11:45 am
Reply with quote
Report this post
Here is the link again.
http://goo.gl/PkkPG9

can you be more specific about which files in the K2 folder to copy? cant seem to locate a tags file.

thanks
User avatar
Fresh Boarder

teitbite
Fri Oct 03, 2014 12:28 pm
Reply with quote
Report this post
Hi

This is a customisation request which we do not support, so I can only give tips, but please edit file: /html/com_k2/template/default/tag.php and replace code:

Code: Select all
            <article class="itemView">
                  <header>
                        <?php if($item->params->get('genericItemTitle')): ?>
                        <h2>
                              <?php if ($item->params->get('genericItemTitleLinked')): ?>
                              <a href="<?php echo $item->link; ?>"> <?php echo $item->title; ?> </a>
                              <?php else: ?>
                              <?php echo $item->title; ?>
                              <?php endif; ?>
                        </h2>
                        <?php endif; ?>
                        
                        <?php if($item->params->get('genericItemCategory')): ?>
                        <ul>
                              <?php if($item->params->get('genericItemDateCreated')): ?>
                              <li><time datetime="<?php echo JHtml::_('date', $item->created, JText::_(DATE_W3C)); ?>"><?php echo JHTML::_('date', $item->created, JText::_('j F Y')); ?></time></li>
                              <?php endif; ?>

                              <?php if($item->params->get('genericItemCategory')) : ?>
                              <li><span><?php echo JText::_('K2_PUBLISHED_IN'); ?></span> <a href="<?php echo $item->category->link; ?>"><?php echo $item->category->name; ?></a></li>
                              <?php endif; ?>
                        </ul>
                        <?php endif; ?>
                  </header>
                  
                  <?php if($item->params->get('genericItemImage') && !empty($item->imageGeneric)): ?>
                  <div class="itemImageBlock"> <a class="itemImage" href="<?php echo $item->link; ?>" title="<?php if(!empty($item->image_caption)) echo $item->image_caption; else echo $item->title; ?>"> <img src="<?php echo $item->imageGeneric; ?>" alt="<?php if(!empty($item->image_caption)) echo $item->image_caption; else echo $item->title; ?>" style="width:<?php echo $item->params->get('itemImageGeneric'); ?>px; height:auto;" /> </a> </div>
                  <?php endif; ?>
                  
                  <div class="itemBody<?php if(!$item->params->get('genericItemDateCreated')): ?> nodate<?php endif; ?>">
                        <?php if($item->params->get('genericItemIntroText')): ?>
                        <div class="itemIntroText"> <?php echo $item->introtext; ?> </div>
                        <?php endif; ?>
                        <?php if($item->params->get('genericItemExtraFields') && count($item->extra_fields)): ?>
                        <div class="itemExtraFields">
                              <h4><?php echo JText::_('K2_ADDITIONAL_INFO'); ?></h4>
                              <ul>
                                          <?php foreach ($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="tagItemExtraFieldsHeader"><?php echo $extraField->name; ?></h4>
                                             <?php else: ?>
                                             <span class="tagItemExtraFieldsLabel"><?php echo $extraField->name; ?></span>
                                             <span class="tagItemExtraFieldsValue"><?php echo $extraField->value; ?></span>
                                             <?php endif; ?>      
                                          </li>
                                          <?php endif; ?>
                                          <?php endforeach; ?>
                                          </ul>
                        </div>
                        <?php endif; ?>
                        <?php if ($item->params->get('genericItemReadMore')): ?>
                        <a class="button" href="<?php echo $item->link; ?>"> <?php echo JText::_('K2_READ_MORE'); ?> </a>
                        <?php endif; ?>
                  </div>
            </article>


with

Code: Select all
                  $this->item=$item;
                  echo $this->loadTemplate('item');


this should work in theory, but there is a lot more elements which will have to be meant.
User avatar
Moderator


cron