Page 1 of 1

[SOLVED] - News Module: Different titles in Summary Page

Posted: Thu Aug 27, 2009 7:17 pm
by jwaldeck
Hello guys!

I'm running a brand new (1.6.4) installation of CMSMS in my Localhost and setting it up I came across something weird I need on my home page.

There's a DIV where I show a news category:

Code: Select all

{cms_module module="news" number="3" category="abipecs-na-imprensa-$lang" detailpage="abipecs"}
It shows the 3 latest news, ok. But the thing I need here is a different heading (h1) for the first item and two h2 headings for the rest. Any idea if that's possible?

I browsed for hours on the forum and couldn't find the answer around!

Thanks in advance for your help!

Cheers,
jw

Re: News Module: Different titles in Summary Page

Posted: Thu Aug 27, 2009 7:30 pm
by JeremyBASS
Sure, go

{assign var=count value=1}

out side the foreach loop

{if $count ==1 }whatever{else}whatever{/if}

and just at the end of the foreach loop add

{assign var=count value=$count+1}

That will work... Hope that helps

Cheers
Jeremy

[SOLVED] - Re: News Module: Different titles in Summary Page

Posted: Thu Aug 27, 2009 8:55 pm
by jwaldeck
Thanks a lot my friend, that was fast!
It worked perfectly!

Final working CODE:

Code: Select all

<!-- Start News Display Template -->


{assign var=count value=1}

{foreach from=$items item=entry}
<div class="NewsSummary">

{if $count ==1 }<h1>{$entry->title|cms_escape}</h1>
{else}<h3>{$entry->title|cms_escape}</h3>
{/if}

{if $entry->summary}
	<div class="NewsSummarySummary">
         <a href="{$entry->moreurl}" title="{$entry->title|cms_escape:htmlall}">
		{eval var=$entry->summary}</a>
	</div>


{else if $entry->content}

	<div class="NewsSummaryContent">
		{eval var=$entry->content}
	</div>
{/if}


</div>
{assign var=count value=$count+1}
{/foreach}
<!-- End News Display Template -->


That's why I LOVE CMSMS and its community!

Cheers,
jw

Re: [SOLVED] - News Module: Different titles in Summary Page

Posted: Thu Aug 27, 2009 9:26 pm
by JeremyBASS
Np... HTH, karma is good for the soul... Have a great one today...

Cheers
Jeremy