Page 1 of 1

news module:change background colors of different items

Posted: Tue Feb 27, 2007 12:09 pm
by lepoticum
heres how i  changed the colors of multiple items in the news module..
for example  needed every secound news item to be a different color.

Soultion:
Just change the smarty news 'Summary Template' to below smarty code and then the classes 'NewsSummary_odd' and 'NewsSummary' are applied to every secound item. just use these classes to style each item.



{foreach from=$items item=entry key=j}
  {if $j % 2 == 1}

{else}

{/if}

{if $entry->formatpostdate}

{$entry->formatpostdate}

{/if}


{$entry->titlelink}



{if $entry->author}

{$author_label} {$entry->author}

{/if}

{if $entry->summary}

{eval var=$entry->summary}



[{$entry->morelink}]


{else if $entry->content}


{eval var=$entry->content}

{/if}



{/foreach}