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

Horizontal menu loop until end of screen

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 11-28-2007, 03:11 PM
 
Chris Berendt Chris Berendt is offline
 

Newbie
  
Join Date: Sep 2007
Posts: 4
 

Unhappy Horizontal menu loop until end of screen

I need to create a loop to display the horizontal menu items until it reaches the end of the screen and then start on the next line. I have written the following code which displays one menu item on the first line and then the rest on the second.

<table cellpadding="0" cellspacing="0" >
<tr >
{foreach from=$categories item="category" name="h_categories"}
{if $smarty.foreach.h_categories.first}
<td class="hcNonActiveItembr{$category.categoryid}" height="25" nowrap="nowrap" valign="bottom">
<a href="home.php?cat={$category.categoryid}" class="hcLink"
onmouseover="rollover('{$category.category}1','{$c ategory.category}1.gif')"
onmouseout="rollover('{$category.category}','{$cat egory.category}.gif')">
<img src="{$ImagesDir}/custom/{$category.category}.gif" name="{$category.category}.gif" alt="{$category.category}"></a>
</td>
</tr>
<tr>
{else}
<td class="hcNonActiveItembr{$category.categoryid}" height="25" nowrap="nowrap" valign="bottom">
<a href="home.php?cat={$category.categoryid}" class="hcLink"
onmouseover="rollover('{$category.category}1','{$c ategory.category}1.gif')"
onmouseout="rollover('{$category.category}','{$cat egory.category}.gif')">
<img src="{$ImagesDir}/custom/{$category.category}.gif" name="{$category.category}.gif" alt="{$category.category}"></a>
{/if}
{/foreach}

Please help.
__________________
Chris Berendt
X-Cart Version 4.1.9
Reply With Quote
  #2  
Old 11-28-2007, 03:40 PM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default Re: Horizontal menu loop until end of screen

Welcome to the X-Cart forums! Please start by reading the following thread, which will help you get started and hopefully make your experience here a positive one:

http://forum.x-cart.com/showthread.php?t=23970

Please note that this link is not an answer to your question, but we need you to update your signature with your X-Cart version so that we can answer your question correctly. Thanks!
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #3  
Old 11-28-2007, 04:01 PM
 
Chris Berendt Chris Berendt is offline
 

Newbie
  
Join Date: Sep 2007
Posts: 4
 

Default Re: Horizontal menu loop until end of screen

Thank you very much for this I am an absolute beginer
__________________
Chris Berendt
X-Cart Version 4.1.9
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:46 PM.

   

 
X-Cart forums © 2001-2020