View Single Post
  #8  
Old 12-31-2009, 09:30 AM
  JWait's Avatar 
JWait JWait is offline
 

X-Man
  
Join Date: Nov 2005
Location: California
Posts: 2,440
 

Default Re: Show manufacturers in columns

For anyone interested, here is what I did for v4.2.x (4.2.3). It displays the manufacturers logos with the name of the manufacturer spelled out below, both are linked to the manufacturer page.

There is a problem. If you do not have a manufacturer logo, the default "no image" image is displayed.

Also, the break tags toward the bottom are there to fill in so that my rounded corners work when ever the number of listings is not equally divisible by the number of columns.

Code:
{* $Id: customer_manufacturers_list.tpl,v 1.9.2.2 2009/02/13 14:15:22 ferz Exp $ vim: set ts=2 sw=2 sts=2 et: *} {capture name=dialog} {include file="customer/main/navigation.tpl"} <ul class="manufacturers-list list-item"> {assign var="col" value="0"} {foreach from=$manufacturers item=v} {if $col == 4}{* Adjust the number of columns *} </ul><ul class="manufacturers-list list-item">{assign var="col" value="0"} {/if} <li><a href="manufacturers.php?manufacturerid={$v.manufacturerid}"> <img src="{$xcart_web_dir}/image.php?id={$v.manufacturerid}&type=M" alt="/"{if $manufacturer.image_x} width="{$manufacturer.image_x}"{/if}{if $manufacturer.image_y} height="{$manufacturer.image_y}"{/if} /> <br /> {$v.manufacturer|escape} </a><br /></li> {assign var="col" value="`$col+1`"} {/foreach} </ul> <br /><br /><br /><br /> {include file="customer/main/navigation.tpl"} {/capture} {include file="customer/dialog.tpl" title=$lng.lbl_manufacturers content=$smarty.capture.dialog}

and in main.css I modified the manufacturers list
Code:
/* manufacturers list */ ul.manufacturers-list { padding: 10px; margin: auto; list-style: none; clear: both; } ul.manufacturers-list li { margin: auto; padding: 5px; white-space: nowrap; display: inline; float: left; text-align: center; /* added to center the displayed images and text */ width: 180px; /* adjust to fit - it is the space between images */ }
__________________
Two Separate X-Cart Stores
Version 4.4.4 Gold - X-AOM - Vivid Dreams Aquamarine (modified) - Linux
Mods - Newest Products - View All -, and a few others. Numerous upgrades from 4.0.x series.
Integrated with Stone Edge Order Manager + POS

Version 4.1.12 Gold (fresh install) - X-AOM - Linux
Mods - XCSEO free
Reply With Quote