X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Limit Manufactures list in the menu not in admin. (https://forum.x-cart.com/showthread.php?t=17810)

komarik 11-07-2005 03:39 PM

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

cbarnes 11-08-2005 07:55 AM

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...

komarik 11-08-2005 08:29 AM

Yeah it worked.
Thanks a lot cbarnes :D


All times are GMT -8. The time now is 06:02 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.