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

Limit Manufactures list in the menu not in admin.

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 11-07-2005, 03:39 PM
 
komarik komarik is offline
 

Advanced Member
  
Join Date: Jun 2003
Posts: 41
 

Default Limit Manufactures list in the menu not in admin.

I have 2 Manufactures Menus in my store.
First is List of all manfactured which is set to 20 in admin, and the other one is the same except it uses icons for each brand instead of text and I want to set it to display only 10.

Here is my menu_manufactures_icon.tpl
Code:
{* $Id: menu_manufacturers.tpl,v 1.4 2004/06/22 05:38:52 max Exp $ *} {capture name=dialog} {if $manufacturers_menu ne ''} <table width="249" border="0" cellspacing="0" cellpadding="0"> <tr> <td>[img]images/title_topbrands.gif[/img]</td> </tr> <tr> <td class="topbrandsbox"><table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td valign="top" width="29">[img]images/11.gif[/img]</td> <td> {assign var="tmp" value="0"} {section name=mid loop=$manufacturers_menu} {if $manufacturers[mid].manufacturerid}{assign var="tmp" value="1"}{/if} {/section} {section name=mid loop=$manufacturers_menu} { if %mid.first% } <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#F27929"> {/if} { if %mid.index% is div by 2} <tr> {/if} <td align="left" valign="middle" class="topbrandsitem"> <table cellspacing="0" cellpadding="3" border="0" width="90"> <tr><td align="left" valign="middle"> [img]mlogo.php?manufacturerid={$manufacturers[mid].manufacturerid}[/img]</td></tr></table></td> { if %mid.last% }</tr> </table> {/if} {/section}</td> <td valign="top" width="25">[img]images/spacer.gif[/img]</td> </tr> </table></td> </tr> <tr> <td class="border1">[img]images/spacer.gif[/img]</td> </tr> </table> {/if}

Thank you.

--------------------
X-Cart Gold 4.0.16
__________________
Webstroika.com - Web / Print / Multimedia
Lambo Doors - Direct Bolt-on Vertical Doors and Universal Vertical Door Conversion Kits - X-cart Gold 4.2.1
Reply With Quote
  #2  
Old 11-08-2005, 07:55 AM
 
cbarnes cbarnes is offline
 

Member
  
Join Date: Oct 2005
Location: Kansas
Posts: 18
 

Default

komarik,

I believe you should be able to use the "max" integer in your {section} loop.

Try replacing this:

Code:
{section name=mid loop=$manufacturers_menu} { if %mid.first% }

with this:

Code:
{section name=mid loop=$manufacturers_menu max=10} { if %mid.first% }

http://smarty.php.net/manual/en/language.function.section.php

Hope this helps...
__________________
Chris Barnes
Ative LLC
X-Cart Development & Consulting
Reply With Quote
  #3  
Old 11-08-2005, 08:29 AM
 
komarik komarik is offline
 

Advanced Member
  
Join Date: Jun 2003
Posts: 41
 

Default

Yeah it worked.
Thanks a lot cbarnes
__________________
Webstroika.com - Web / Print / Multimedia
Lambo Doors - Direct Bolt-on Vertical Doors and Universal Vertical Door Conversion Kits - X-cart Gold 4.2.1
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



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 10:59 AM.

   

 
X-Cart forums © 2001-2020