News module

General project discussion. NOT for help questions.
Post Reply
jondrew
Forum Members
Forum Members
Posts: 23
Joined: Thu Apr 03, 2008 9:59 am

News module

Post by jondrew »

Hi

How do I alter the number of charecters or words that are displayed from the news summary. IE I want to limit the length of the news summary on my homepage so it only displays approx. 25 words?

thanks

Jon
moorezilla

Re: News module

Post by moorezilla »

Whatever you put in the summary field shows up in the summary, so you can just put whatever number of words you want. If you don't put anything in the summary, and put all of your text in the content area, then it all shows up as a summary, I believe.
User avatar
Nullig
Power Poster
Power Poster
Posts: 2380
Joined: Fri Feb 02, 2007 4:31 pm

Re: News module

Post by Nullig »

You could use the smarty truncate function to limit the number of characters displayed.

Change the summary fields in your news templates from:

{eval var=$entry->summary}

to:

{eval var=$entry->summary|truncate:200}

or whatever number of characters you want to display. This will cut off the output at a the end of a word and add "...".

Nullig
jondrew
Forum Members
Forum Members
Posts: 23
Joined: Thu Apr 03, 2008 9:59 am

Re: News module

Post by jondrew »

Hey The truncate thing worked perfect!! ;D cheers
Post Reply

Return to “General Discussion”