How to tell CMSMS to post whole news articles?

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
slartibartfast

How to tell CMSMS to post whole news articles?

Post 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
Last edited by slartibartfast on Mon May 07, 2007 12:30 pm, edited 1 time in total.
slartibartfast

Re: How to set the length of the News summary

Post by slartibartfast »

Anyone ??? ? This issue really is annoying the hell out of me... please, pretty please with a cherry on top?
cyberman

Re: How to set the length of the News summary

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

Re: How to set the length of the News summary

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

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

Post by cyberman »

Smarty is template engine of CMSms. If you use CMSms you use Smarty :).
slartibartfast

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

Post by slartibartfast »

Ok,  :-[  I guess a day nothing learned is a day wasted...;)
slartibartfast

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

Post 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?
Locked

Return to “CMSMS Core”