Page 1 of 1

How to tell CMSMS to post whole news articles?

Posted: Wed May 02, 2007 4:32 pm
by slartibartfast
Hey there,

(using PHP 5.2.1, Apache 2.2.4, MySql 5.0.22)

I have a question, I would like to shorten the length of the news summary (news module version 2.2) to a lenth I would like to set. I found this old topic but I think the news module has changes since then...

I tried something like this in the news summery template:

Code: Select all

{if $entry->summary}
	<div class="NewsSummarySummary">
		{eval var=$entry->summary}
{$entry->summary|truncate:30:"...":false}

	</div>

	<div class="NewsSummaryMorelink">
		[{$entry->morelink}]
	</div>

{else if $entry->content}

	<div class="NewsSummaryContent">
		{eval var=$entry->content}
	</div>
{/if}
I found this code here, but it didn't do anything I could notice (and what would the 30 represent anyway?)

So I would appreciate it if someone could tell how to do this,

Oh and btw, just to be on the safe side, how do tell the news module it is the summery I want and not the whole article?

Thanks in advance,

Andrew

Re: How to set the length of the News summary

Posted: Fri May 04, 2007 9:03 am
by slartibartfast
Anyone ??? ? This issue really is annoying the hell out of me... please, pretty please with a cherry on top?

Re: How to set the length of the News summary

Posted: Fri May 04, 2007 9:34 am
by cyberman
truncate has nothing to do with news module cause it's a smarty modifier.

Please look here how to use

http://smarty.php.net/manual/en/languag ... uncate.php

Re: How to set the length of the News summary

Posted: Sun May 06, 2007 5:43 pm
by slartibartfast
Hmm, ok but how come it does work in CMSMS while I don't have smarty installed? I worked out how to use it and what the number stands for (characters+spaces).

my summary template now reads

Code: Select all

{if $entry->summary}
	<div class="NewsSummarySummary">
		{eval var=$entry->summary|truncate:150}
	</div>

	<div class="NewsSummaryMorelink">
		[{$entry->morelink}]
	</div>

{else if $entry->content}

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

Re: How to set the length of the News summary [solved]

Posted: Mon May 07, 2007 5:26 am
by cyberman
Smarty is template engine of CMSms. If you use CMSms you use Smarty :).

Re: How to set the length of the News summary [solved]

Posted: Mon May 07, 2007 12:28 pm
by slartibartfast
Ok,  :-[  I guess a day nothing learned is a day wasted...;)

Re: How to tell CMSMS to post whole news articles?

Posted: Mon May 07, 2007 12:41 pm
by slartibartfast
Ok, I didn't wont to start a whole new topic because my question is related. In want to include a page with all (or a set number of) the news articles. If I try to include the news article in this manner:

Code: Select all

{news number='5'}
into my content page I just get a listing of the news article summaries in stead of the whole articles. If I then follow the article link I get the whole article with the summaries at the bottom...

What do I do to get a listing of all the whole articles?