Alternating display dependent on news category [solved - nearly]
Posted: Tue Jan 13, 2009 10:16 pm
Hi
Can anyone point me in the right direction. I am trying to write a news summary template that will display the news summaries with different colour backgrounds dependent on their category.
I though that I could check the category value and use "if" "elseif" staements dependent on the category name. I don't seem to be able to get the category name/variable to check though.
Something like the above then adding elseif statements. I hope I have explained myself OK.
Any advice help gratefully received.
Can anyone point me in the right direction. I am trying to write a news summary template that will display the news summaries with different colour backgrounds dependent on their category.
I though that I could check the category value and use "if" "elseif" staements dependent on the category name. I don't seem to be able to get the category name/variable to check though.
Code: Select all
<!-- Start Notice Display Template -->
{foreach from=$items item=entry}
{if $category_label=="purple_notice"}
<div class="purplenotice">
<h3>{$entry->title}</h3>
{if $entry->summary}
<p>{eval var=$entry->summary}</p>
{/if}
</div>
{/if}
{/foreach}
<!-- End Notice Display Template -->Any advice help gratefully received.