news module:change background colors of different items

Do something cool with CMS? Show us ...
This board is for 'Answers', and the discussion of answers... Not for questions.
Post Reply
lepoticum

news module:change background colors of different items

Post 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}

Post Reply

Return to “Tips and Tricks”