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

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Locked
jwaldeck

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

Post 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
Attachments
print-news.jpg
Last edited by jwaldeck on Thu Aug 27, 2009 8:55 pm, edited 1 time in total.
JeremyBASS

Re: News Module: Different titles in Summary Page

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

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

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

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

Post by JeremyBASS »

Np... HTH, karma is good for the soul... Have a great one today...

Cheers
Jeremy
Locked

Return to “CMSMS Core”