Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

$Content.Summary() to show more than just first paragraph?


Go to End


2 Posts   6450 Views

Avatar
deeve007

Community Member, 3 Posts

27 August 2009 at 1:03am

Hey,

I want to display 4 recent articles on the Homepage, and a certain number of words or characters for each article, so even if an article has a short first sentence it will show a little of the second sentence to ensure that all 4 have a consistent amount of text. $Content.Summary() ends at the end of the first paragraph.

Is this possible, and if so how is it done?

Avatar
deeve007

Community Member, 3 Posts

27 August 2009 at 1:32am

Okay, have found this page here: http://api.silverstripe.com/sapphire/model/Text.html

Now the issue here is that any option seems to either stripe HTML tags altogether, so no paragraph breaks, or else LimitWordCountXML adds extgra <br /> tags for no apparent reason within the text.