Limiting a foreach loop to 4 iterations only
Posted: Sun Feb 24, 2008 4:49 am
Hi,
I'm trying to make a "more articles" type of box for my content pages. I'm using a modded menu template to do this, so the call to the menu manager is as follows:
{menu template='minimalmenu' start_element="2.1" show_root_siblings="1"}
It will only show sibling articles, which is what I want.
The problem is, it is listing all articles. I want it to just show, say, the top 5 articles then a "View All" link. I'm trying to mod the minimalmenu template to do this, but I'm new to smarty and am having trouble.
Essentially, I want the foreach loop to only loop 4 times then quit. How can this be done?
Any help would be appreciated.
Thanks and regards,
Jazz
I'm trying to make a "more articles" type of box for my content pages. I'm using a modded menu template to do this, so the call to the menu manager is as follows:
{menu template='minimalmenu' start_element="2.1" show_root_siblings="1"}
It will only show sibling articles, which is what I want.
The problem is, it is listing all articles. I want it to just show, say, the top 5 articles then a "View All" link. I'm trying to mod the minimalmenu template to do this, but I'm new to smarty and am having trouble.
Essentially, I want the foreach loop to only loop 4 times then quit. How can this be done?
Any help would be appreciated.
Thanks and regards,
Jazz