Keyword

Help with css on a Tag Menu page

  • Brenda
  • Brenda's Avatar Topic Author
  • Offline
  • New Member
More
13 years 20 hours ago #96806 by Brenda
Help with css on a Tag Menu page was created by Brenda
I limited the introtext word count by making this change to generic.php

<?php if($item->params->get('genericItemIntroText')): ?>              <!-- Item introtext -->              <div class="genericItemIntroText">              <?php echo K2HelperUtilities::wordLimit($item->introtext,25);?>                  </div>              <?php endif; ?>

Then I edited the k2.css to make it 2 columns:

div.genericItemView {    border-top: 1px solid #FF9933;    padding: 0px;    margin: 50px 0 0 0;    width: 50%;    float: left;}/* this is the item container for this view */

but if you look at the page, most of the rows have 2 items in it, but some have a blank spot and then just 1 item:  www.piggygiggles.com/crafts-for-girls

I'm trying to get it to look like my layout in category layout:  www.piggygiggles.com/crafts-for-kids/foam-crafts

 

 
Attachments:

Please Log in or Create an account to join the conversation.

  • Yiota
  • Yiota's Avatar
  • Visitor
13 years 11 hours ago #96807 by Yiota
Replied by Yiota on topic Help with css on a Tag Menu page
In generic.php locate the foreach right after the genericItemList div container and replace it with this:

<?php foreach($this->items as $key=>$item): ?>

Then go to the endforeach and right before that put this

<?php if(($key+1)%2)==0): ?>    <div class="clr"></div><?php endif; ?>

 

This will just put a clear div after the second column.

Please Log in or Create an account to join the conversation.

  • Brenda
  • Brenda's Avatar Topic Author
  • Offline
  • New Member
More
13 years 6 hours ago #96808 by Brenda
Replied by Brenda on topic Help with css on a Tag Menu page
Thanks for your fast response!

When I added the code, I got:

Parse error: syntax error, unexpected T_IS_EQUAL in .../html/com_k2/templates/generic.php on line 128 Yiota Ziaggou said:

In generic.php locate the foreach right after the genericItemList div container and replace it with this:

<?php foreach($this->items as $key=>$item): ?>

Then go to the endforeach and right before that put this

<?php if(($key+1)%2)==0): ?>    <div class="clr"></div><?php endif; ?>

 

This will just put a clear div after the second column.

 

 

Here is my entire file:

&lt;?php/** * @version        $Id: generic.php 478 2010-06-16 16:11:42Z joomlaworks $ * @package        K2 * @author        JoomlaWorks www.joomlaworks.gr * @copyright    Copyright (c) 2006 - 2010 JoomlaWorks, a business unit of Nuevvo Webware Ltd. All rights reserved. * @license        GNU/GPL license: www.gnu.org/copyleft/gpl.html */// no direct accessdefined('_JEXEC') or die('Restricted access');?><!-- Start K2 Generic Layout --><div id="k2Container" class="genericView<?php if($this->params->get('pageclass_sfx')) echo ' '.$this->params->get('pageclass_sfx'); ?>">    <?php if($this->params->get('show_page_title')): ?>    <!-- Page title -->    <div class="componentheading<?php echo $this->params->get('pageclass_sfx')?>">        <?php echo $this->escape($this->params->get('page_title')); ?>    </div>    <?php endif; ?>    <?php if($this->params->get('userFeed')): ?>    <!-- RSS feed icon -->    <div class="k2FeedIcon">        <a href="/<?php echo $this->feed; ?>" title="<?php echo JText::_('Subscribe to this RSS feed'); ?>">            <span><?php echo JText::_('Subscribe to this RSS feed'); ?></span>        </a>        <div class="clr"></div>    </div>    <?php endif; ?>    <?php if(count($this->items)): ?>    <div class="genericItemList"><?php foreach($this->items as $key=>$item): ?>        <!-- Start K2 Item Layout -->        <div class="genericItemView">            <div class="genericItemHeader">                <?php if($item->params->get('genericItemDateCreated')): ?>                <!-- Date created -->                <span class="genericItemDateCreated">                    <?php echo JHTML::_('date', $item->created , JText::_('DATE_FORMAT_LC2')); ?>                </span>                <?php endif; ?>                          <?php if($item->params->get('genericItemTitle')): ?>              <!-- Item title -->              <h2 class="genericItemTitle">                  <?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; ?>          </div>          <div class="genericItemBody">              <?php if($item->params->get('genericItemImage') && !empty($item->imageGeneric)): ?>              <!-- Item Image -->              <div class="genericItemImageBlock">                  <span class="genericItemImage">                    <a 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:150px; height:auto;" />                    </a>                  </span>                  <div class="clr"></div>              </div>              <?php endif; ?>                            <?php if($item->params->get('genericItemIntroText')): ?>              <!-- Item introtext -->              <div class="genericItemIntroText">              <?php echo K2HelperUtilities::wordLimit($item->introtext,25);?>                  </div>              <?php endif; ?>              <div class="clr"></div>          </div>                    <div class="clr"></div>                    <?php if($item->params->get('genericItemExtraFields') && count($item->extra_fields)): ?>          <!-- Item extra fields -->            <div class="genericItemExtraFields">              <h4><?php echo JText::_('Additional Info'); ?></h4>              <ul>                <?php foreach ($item->extra_fields as $key=>$extraField): ?>                <li class="<?php echo ($key%2) ? "odd" : "even"; ?> type<?php echo ucfirst($extraField->type); ?> group<?php echo $extraField->group; ?>">                    <span class="genericItemExtraFieldsLabel"><?php echo $extraField->name; ?></span>                    <span class="genericItemExtraFieldsValue"><?php echo $extraField->value; ?></span>                        </li>                <?php endforeach; ?>                </ul>            <div class="clr"></div>          </div>          <?php endif; ?>                      <?php if($item->params->get('genericItemCategory')): ?>            <!-- Item category name -->            <div class="genericItemCategory">                <span><?php echo JText::_('Published in'); ?></span>                <a href="/<?php echo $item->category->link; ?>"><?php echo $item->category->name; ?></a>            </div>            <?php endif; ?>                        <?php if ($item->params->get('genericItemReadMore')): ?>            <!-- Item "read more..." link -->            <div class="genericItemReadMore">                <a class="k2ReadMore" href="/<?php echo $item->link; ?>">                    <?php echo JText::_('Read more...'); ?>                </a>            </div>            <?php endif; ?>            <div class="clr"></div>        </div>        <!-- End K2 Item Layout -->        <?php if(($key+1)%2)==0): ?>    <div class="clr"></div><?php endif; ?>        <?php endforeach; ?>    </div><div class="clr"></div>    <!-- Pagination -->    <?php if($this->pagination->getPagesLinks()): ?>    <div class="k2Pagination">        <?php echo $this->pagination->getPagesLinks(); ?>        <div class="clr"></div>        <?php echo $this->pagination->getPagesCounter(); ?>    </div>    <?php endif; ?>    <?php endif; ?>    </div><!-- End K2 Generic Layout -->

Please Log in or Create an account to join the conversation.

  • Yiota
  • Yiota's Avatar
  • Visitor
13 years 6 hours ago #96809 by Yiota
Replied by Yiota on topic Help with css on a Tag Menu page
Change the $key variable to $keyItem. The $key variable is also used in the extrafields, probably that is why you get an error.

Please Log in or Create an account to join the conversation.

  • Brenda
  • Brenda's Avatar Topic Author
  • Offline
  • New Member
More
13 years 6 hours ago #96810 by Brenda
Replied by Brenda on topic Help with css on a Tag Menu page
I still got:

Parse error: syntax error, unexpected T_IS_EQUAL in /home/.../public_html/templates/.../html/com_k2/templates/generic.php on line 129

 

I put the

&lt;?php if(($keyItem+1)%2)==0): ?&gt;    &lt;div class="clr"&gt;&lt;/div&gt;&lt;?php endif; ?&gt;

right before the endforeach that was before the Pagination section, there were two endforeach.  Did I put it in the right spot?



Here's my new file:

&lt;?php/** * @version        $Id: generic.php 478 2010-06-16 16:11:42Z joomlaworks $ * @package        K2 * @author        JoomlaWorks www.joomlaworks.gr * @copyright    Copyright (c) 2006 - 2010 JoomlaWorks, a business unit of Nuevvo Webware Ltd. All rights reserved. * @license        GNU/GPL license: www.gnu.org/copyleft/gpl.html */// no direct accessdefined('_JEXEC') or die('Restricted access');?><!-- Start K2 Generic Layout --><div id="k2Container" class="genericView<?php if($this->params->get('pageclass_sfx')) echo ' '.$this->params->get('pageclass_sfx'); ?>">    <?php if($this->params->get('show_page_title')): ?>    <!-- Page title -->    <div class="componentheading<?php echo $this->params->get('pageclass_sfx')?>">        <?php echo $this->escape($this->params->get('page_title')); ?>    </div>    <?php endif; ?>    <?php if($this->params->get('userFeed')): ?>    <!-- RSS feed icon -->    <div class="k2FeedIcon">        <a href="/<?php echo $this->feed; ?>" title="<?php echo JText::_('Subscribe to this RSS feed'); ?>">            <span><?php echo JText::_('Subscribe to this RSS feed'); ?></span>        </a>        <div class="clr"></div>    </div>    <?php endif; ?>    <?php if(count($this->items)): ?>    <div class="genericItemList">        <?php foreach($this->items as $keyItem=>$item): ?>        <!-- Start K2 Item Layout -->        <div class="genericItemView">            <div class="genericItemHeader">                <?php if($item->params->get('genericItemDateCreated')): ?>                <!-- Date created -->                <span class="genericItemDateCreated">                    <?php echo JHTML::_('date', $item->created , JText::_('DATE_FORMAT_LC2')); ?>                </span>                <?php endif; ?>                          <?php if($item->params->get('genericItemTitle')): ?>              <!-- Item title -->              <h2 class="genericItemTitle">                  <?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; ?>          </div>          <div class="genericItemBody">              <?php if($item->params->get('genericItemImage') && !empty($item->imageGeneric)): ?>              <!-- Item Image -->              <div class="genericItemImageBlock">                  <span class="genericItemImage">                    <a 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:150px; height:auto;" />                    </a>                  </span>                  <div class="clr"></div>              </div>              <?php endif; ?>                            <?php if($item->params->get('genericItemIntroText')): ?>              <!-- Item introtext -->              <div class="genericItemIntroText">              <?php echo K2HelperUtilities::wordLimit($item->introtext,25);?>                  </div>              <?php endif; ?>              <div class="clr"></div>          </div>                    <div class="clr"></div>                    <?php if($item->params->get('genericItemExtraFields') && count($item->extra_fields)): ?>          <!-- Item extra fields -->            <div class="genericItemExtraFields">              <h4><?php echo JText::_('Additional Info'); ?></h4>              <ul>                <?php foreach ($item->extra_fields as $key=>$extraField): ?>                <li class="<?php echo ($key%2) ? "odd" : "even"; ?> type<?php echo ucfirst($extraField->type); ?> group<?php echo $extraField->group; ?>">                    <span class="genericItemExtraFieldsLabel"><?php echo $extraField->name; ?></span>                    <span class="genericItemExtraFieldsValue"><?php echo $extraField->value; ?></span>                        </li>                <?php endforeach; ?>                </ul>            <div class="clr"></div>          </div>          <?php endif; ?>                      <?php if($item->params->get('genericItemCategory')): ?>            <!-- Item category name -->            <div class="genericItemCategory">                <span><?php echo JText::_('Published in'); ?></span>                <a href="/<?php echo $item->category->link; ?>"><?php echo $item->category->name; ?></a>            </div>            <?php endif; ?>                        <?php if ($item->params->get('genericItemReadMore')): ?>            <!-- Item "read more..." link -->            <div class="genericItemReadMore">                <a class="k2ReadMore" href="/<?php echo $item->link; ?>">                    <?php echo JText::_('Read more...'); ?>                </a>            </div>            <?php endif; ?>            <div class="clr"></div>        </div>        <!-- End K2 Item Layout -->            <?php if(($keyItem+1)%2)==0): ?>    <div class="clr"></div><?php endif; ?>            <?php endforeach; ?>    </div><div class="clr"></div>    <!-- Pagination -->    <?php if($this->pagination->getPagesLinks()): ?>    <div class="k2Pagination">        <?php echo $this->pagination->getPagesLinks(); ?>        <div class="clr"></div>        <?php echo $this->pagination->getPagesCounter(); ?>    </div>    <?php endif; ?>    <?php endif; ?>    </div><!-- End K2 Generic Layout -->

Please Log in or Create an account to join the conversation.

  • Yiota
  • Yiota's Avatar
  • Visitor
13 years 5 hours ago #96811 by Yiota
Replied by Yiota on topic Help with css on a Tag Menu page
Replace

&lt;?php if(($keyItem+1)%2)==0): ?&gt;    &lt;div class="clr"&gt;&lt;/div&gt;&lt;?php endif; ?&gt;

with the

&lt;?php if(($keyItem+1)%2==0): ?&gt;            &lt;div class="clr"&gt;&lt;/div&gt;&lt;?php endif; ?&gt;

 

There is an extra parenthesis that is not closed to the first if statement.

 

 

Please Log in or Create an account to join the conversation.

  • Brenda
  • Brenda's Avatar Topic Author
  • Offline
  • New Member
More
13 years 4 hours ago #96812 by Brenda
Replied by Brenda on topic Help with css on a Tag Menu page
BEAUTIFUL!!  Thank you so much for your help!!  IT works perfectly

Please Log in or Create an account to join the conversation.

  • Brenda
  • Brenda's Avatar Topic Author
  • Offline
  • New Member
More
12 years 9 months ago #96813 by Brenda
Replied by Brenda on topic Help with css on a Tag Menu page
Do you know how to change the number of items that pull up on my Tag Results pages?  Right now it's showing 10 items and I'd like to increase it.

Please Log in or Create an account to join the conversation.

  • Yiota
  • Yiota's Avatar
  • Visitor
12 years 9 months ago #96814 by Yiota
Replied by Yiota on topic Help with css on a Tag Menu page
Go to the general K2 parameters and change the number through there.

Please Log in or Create an account to join the conversation.

  • Brenda
  • Brenda's Avatar Topic Author
  • Offline
  • New Member
More
12 years 9 months ago #96815 by Brenda
Replied by Brenda on topic Help with css on a Tag Menu page
thanks, I didn't see it there when I looked.  Now I found it

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum