Page 1 of 1

[SOLVED] News Summary template column repeater

Posted: Fri Sep 18, 2009 5:30 pm
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.

Re: News Summary template column repeater

Posted: Fri Sep 18, 2009 6:01 pm
by RonnyK
WHat about calling news twice...

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

Ronny

Re: News Summary template column repeater

Posted: Fri Sep 18, 2009 7:55 pm
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.