[SOLVED] News Summary template column repeater

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
folco3
Forum Members
Forum Members
Posts: 22
Joined: Wed Jun 03, 2009 4:28 am

[SOLVED] News Summary template column repeater

Post by folco3 »

I would like to create a summary template that would organize things into columns, say like 3 rows per column and then start a new column. This is very simplified but the html generated would look something like this:



News Item1
News Item2
News Item3


News Item4
News Item5
News Item6



Seems like there has got to be an easy way of doing this, I just don't know the smarty code well enough.
Last edited by folco3 on Fri Sep 18, 2009 7:55 pm, edited 1 time in total.
RonnyK
Support Guru
Support Guru
Posts: 4962
Joined: Wed Oct 25, 2006 8:29 pm
Location: Raalte, the Netherlands

Re: News Summary template column repeater

Post by RonnyK »

WHat about calling news twice...

{news number=3}
{news number=3 start=3} in the second column

Ronny
folco3
Forum Members
Forum Members
Posts: 22
Joined: Wed Jun 03, 2009 4:28 am

Re: News Summary template column repeater

Post by folco3 »

That's not a bad idea, however I want it so my numbers of columns and grow or shrink based on the number of entries.
Poking around other's code here's what I found that works pretty well:


{if isset($items)}

{foreach from=$items item=entry key=j}
detail_url}">{$entry->company_name}

{if ($j+1) % 5 == 0}

{/if}
{/foreach}

{/if}


Every 5th item is starts a new list item.
Post Reply

Return to “Modules/Add-Ons”