Hello guys,
Im using an array to display menu items, it looks like this:
[code]
{foreach from=$aMenuItems item=aMenuItem}
<td class=”menu” onclick=”javascript:window.location.href='{$aMenuItem.url}’;” onmouseover=”this.className=’menu2′;” onmouseout=”this.className=’menu’;”>
<a href=”{$aMenuItem.url}”>{$aMenuItem.title}</a>
</td>
{/foreach}
This part is working perfectly.
But now I realize I have too many items in the menu and want to insert a new row.
Im using Smarty obviously.
so I tried using [b/assign[/b] in the php file but its not working too well so figured it would be easier to just use a counter and when it reaches say 10 elements to just output the end of the row and the start of a new one (</tr></tr>). ==> I realize this would break the table structure but thats not important, once I get this step working I can output a new table if needed.
So here’s my other attempt:
[code=html]
{counter start=0 skip=1}
{foreach from=$aMenuItems item=aMenuItem}
{if counter == ’10’}
</tr><tr>
{else}
{counter}
{/if}
<td class=”menu” onclick=”javascript:window.location.href='{$aMenuItem.url}’;” onmouseover=”this.className=’menu2′;” onmouseout=”this.className=’menu’;”>
<a href=”{$aMenuItem.url}”>{$aMenuItem.title}</a>
</td>
{/foreach}
I tried with and without single quotes on the [i]counter == ’10’
Can somebody please tell me how to do this?
thank you for your time ?