Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

Show manufacturers in columns

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 11-15-2009, 12:53 PM
  Warwick's Avatar 
Warwick Warwick is offline
 

X-Adept
  
Join Date: Mar 2003
Location: Somewhere on the web through European connection
Posts: 868
 

Question Show manufacturers in columns

Is there anybody who knows how to display all manufacturers on the manufacturer page in columns?

Now you get this tiny row, filling up the left column with 80% of the page not filled.

The file I mean is:
skin1/modules/Manufacturers/customer_manufacturer_products.tpl
__________________
Installs: X-Cart 4.1.x - 4.4.x ∙∙ MySQL version: 5.0.45 ∙∙ Apache version: 2.2.8 (Unix) ∙∙ PHP version: 5.25
X-Cart add-ons: all ∙∙ Mods: A lot; too many ∙∙ Skin templates: Many
∙∙ Experience: Somewhere beyond newbie
-----------------------------------
------------------------------------------------------------------------------------------------------
Looking for the best dutch language pack? 4.1.x - 4.6.x compatibel, native speaker translation! More info
Reply With Quote
  #2  
Old 11-16-2009, 03:23 AM
  Zaja's Avatar 
Zaja Zaja is offline
 

X-Adept
  
Join Date: Mar 2004
Location: The Universe is my home
Posts: 420
 

Default Re: Show manufacturers in columns

1. Open /skin1/modules/Manufacturers/customer_manufacturers_list.php

2. Replace:
Code:
<ul class="manufacturers-list list-item"> {foreach from=$manufacturers item=v} <li><a href="manufacturers.php?manufacturerid={$v.manufacturerid}">{$v.manufacturer|escape}</a></li> {/foreach} </ul>

with:
Code:
<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}">{$v.manufacturer|escape}</a></li> {assign var="col" value="`$col+1`"} {/foreach} </ul>

3. Add/replace this code in main.css:
Code:
/* manufacturers list */ ul.manufacturers-list { padding: 0; margin: 0 0 8px 0; list-style: none; clear: both; } ul.manufacturers-list li { margin: 0; padding: 2px; white-space: nowrap; display: inline; float: left; width:100px; }


Optional postinstallation steps:
- adjust the number of columns: {if $col ==
4}
__________________
_/ _/ _/ _/ _/ _/ _/ _/ _/

7dana.com
Reply With Quote

The following user thanks Zaja for this useful post:
JWait (12-30-2009)
  #3  
Old 11-16-2009, 03:44 AM
  Warwick's Avatar 
Warwick Warwick is offline
 

X-Adept
  
Join Date: Mar 2003
Location: Somewhere on the web through European connection
Posts: 868
 

Default Re: Show manufacturers in columns

Thanks, a great start!

Some how it isn't showing things consistent and left aligned, see attachment, do you have any ideas?

And where do you set the number of manufactures shown per page?
Attached Thumbnails
Click image for larger version

Name:	screen.png
Views:	248
Size:	18.6 KB
ID:	1717  
__________________
Installs: X-Cart 4.1.x - 4.4.x ∙∙ MySQL version: 5.0.45 ∙∙ Apache version: 2.2.8 (Unix) ∙∙ PHP version: 5.25
X-Cart add-ons: all ∙∙ Mods: A lot; too many ∙∙ Skin templates: Many
∙∙ Experience: Somewhere beyond newbie
-----------------------------------
------------------------------------------------------------------------------------------------------
Looking for the best dutch language pack? 4.1.x - 4.6.x compatibel, native speaker translation! More info
Reply With Quote
  #4  
Old 11-16-2009, 04:03 AM
  Zaja's Avatar 
Zaja Zaja is offline
 

X-Adept
  
Join Date: Mar 2004
Location: The Universe is my home
Posts: 420
 

Default Re: Show manufacturers in columns

1. Remove this style definitions from code:
Code:
style="display: inline;padding:5px;"

2. Replace </ul><ul> with </ul><ul class="manufacturers-list list-item">

3. Add/replace this code in main.css:
Code:
/* manufacturers list */ ul.manufacturers-list { padding: 0; margin: 0 0 8px 0; list-style: none; clear: both; } ul.manufacturers-list li { margin: 0; padding: 2px; white-space: nowrap; display: inline; float: left; width:100px; }
__________________
_/ _/ _/ _/ _/ _/ _/ _/ _/

7dana.com
Reply With Quote
  #5  
Old 11-16-2009, 04:19 AM
  Zaja's Avatar 
Zaja Zaja is offline
 

X-Adept
  
Join Date: Mar 2004
Location: The Universe is my home
Posts: 420
 

Default Re: Show manufacturers in columns

Quote:
Originally Posted by Warwick
And where do you set the number of manufactures shown per page?

In manufactures setting(admin area).
__________________
_/ _/ _/ _/ _/ _/ _/ _/ _/

7dana.com
Reply With Quote
  #6  
Old 11-16-2009, 10:39 AM
  Warwick's Avatar 
Warwick Warwick is offline
 

X-Adept
  
Join Date: Mar 2003
Location: Somewhere on the web through European connection
Posts: 868
 

Default Re: Show manufacturers in columns

Thanks again, one final small details, how to get the background color underneath the manufacturers again? See screendump to get an idea.
Attached Thumbnails
Click image for larger version

Name:	screen1.png
Views:	244
Size:	20.0 KB
ID:	1719  
__________________
Installs: X-Cart 4.1.x - 4.4.x ∙∙ MySQL version: 5.0.45 ∙∙ Apache version: 2.2.8 (Unix) ∙∙ PHP version: 5.25
X-Cart add-ons: all ∙∙ Mods: A lot; too many ∙∙ Skin templates: Many
∙∙ Experience: Somewhere beyond newbie
-----------------------------------
------------------------------------------------------------------------------------------------------
Looking for the best dutch language pack? 4.1.x - 4.6.x compatibel, native speaker translation! More info
Reply With Quote
  #7  
Old 12-21-2009, 02:52 AM
  proboscidian's Avatar 
proboscidian proboscidian is offline
 

Senior Member
  
Join Date: May 2005
Location: Clearwater, FL
Posts: 146
 

Default Re: Show manufacturers in columns

Put
Code:
<div class="clearb">&nbsp;</div>
before
Code:
{include file="customer/main/navigation.tpl"}
to keep the second pagination link below the lists and to keep your footer in place.
__________________
Industrial Webworks
Various xcart versions from 4.1.19 gold - 4.7 gold
http://www.industrialwebworks.net
Reply With Quote
  #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

The following 4 users thank JWait for this useful post:
ADDISON (09-21-2012), eaglemobiles (05-18-2010), Keely (02-14-2010), kitschydigitals (05-17-2012)
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 04:50 AM.

   

 
X-Cart forums © 2001-2020