Author Topic: Categories Page -> Images & titles not aligning properly -> FIX  (Read 8830 times)

Offline JHammond53

  • Newbie
  • *
  • Posts: 39
  • Karma: +11/-0
    • View Profile
Categories Page -> Images & titles not aligning properly -> FIX
« on: November 06, 2013, 09:50:14 AM »
When on a category page viewing all of the subcategories, the images do not line up with the titles below them. I am not sure if a fix has been posted yet so here is the fix that works for me.

You will need to modify the following file "public_html --> storefront --> view --> default_html5 --> template --> pages --> product --> category.tpl"

Lines 15-26 of the original category.tpl file should read as follows:

   <ul class="thumbnails row">
       <?php for ($i = 0; $i < sizeof($categories); $i++) { ?>
        <li class="span2">
          <a href="<?php echo $categories[ $i ][ 'href' ]; ?>">
             <?php echo $categories[ $i ][ 'thumb' ][ 'thumb_html' ]; ?>
          </a>
          <div class="span2">
          <a href="<?php echo $categories[ $i ][ 'href' ]; ?>"><?php echo $categories[ $i ][ 'name' ]; ?></a>
          </div>
       </li>
       <?php } ?>
   </ul>


Replace these lines with the following code:

   <ul class="thumbnails row">
       <?php for ($i = 0; $i < sizeof($categories); $i++) { ?>
        <li class="span2">
          <center><a href="<?php echo $categories[ $i ][ 'href' ]; ?>">
             <?php echo $categories[ $i ][ 'thumb' ][ 'thumb_html' ]; ?>
          </a></center>
          <center><div style="text-align:center;">
          <a href="<?php echo $categories[ $i ][ 'href' ]; ?>"><?php echo $categories[ $i ][ 'name' ]; ?></a>
          </div></center>
       </li>
       <?php } ?>
   </ul>


All changes have been marked with the color red if you want to just add the fix I used instead of replacing the entire code snippet.
« Last Edit: November 06, 2013, 09:52:23 AM by JHammond53 »

Offline abantecart

  • Administrator
  • Hero Member
  • *****
  • Posts: 4358
  • Karma: +298/-10
    • View Profile
    • Ideal Open Source Ecommerce Solution
Re: Categories Page -> Images & titles not aligning properly -> FIX
« Reply #1 on: November 07, 2013, 03:55:48 PM »
What version of AbanteCart and template do you post this fix for?

If I look at v1.1.7 and HTML5 it is already centered.
Please  rate your experience or leave your review
We need your help to build better free open source ecommerce platform for everyone. See how you can help

Offline JHammond53

  • Newbie
  • *
  • Posts: 39
  • Karma: +11/-0
    • View Profile
Re: Categories Page -> Images & titles not aligning properly -> FIX
« Reply #2 on: November 08, 2013, 01:04:32 PM »
The latest version and HTML5 template. It wasn't centered for me using google chrome. I tested this outside of my site by viewing the demo and others' pages as well with none of them being centered for me.

EDIT: Here is one of the sites that don't center for me. I can't add links but its     bubblegum-web.com/index.php?rt=product/category&path=65

EDIT 2:  I just tested that same site using Firefox (outdated) and IE9 and neither one was centered??
« Last Edit: November 08, 2013, 01:12:04 PM by JHammond53 »

Offline junkyard

  • Full Member
  • ***
  • Posts: 127
  • Karma: +25/-0
    • View Profile

Offline JHammond53

  • Newbie
  • *
  • Posts: 39
  • Karma: +11/-0
    • View Profile
Re: Categories Page -> Images & titles not aligning properly -> FIX
« Reply #4 on: November 13, 2013, 01:48:55 PM »
Good to hear that you guys had a fix for it already! I was sure there'd already be a fix out there but then after looking at a few sites built by others I began to wonder. I've done other code changes inside my category.tpl prior to realizing things weren't centering so a simple copy-paste wouldn't do it for me anyway.

It seems as if a lot of bugs have been worked out, its just hard locating the fix sometimes.

 

Powered by SMFPacks Social Login Mod