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:

Archive /

Our old forums are still available as a read-only archive.

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

How to get links with LimitWordCount?

Go to End

6 Posts   2970 Views


49 Posts

30 September 2007 at 1:16am

As it is now, I'm showing snippets of news on my homepage with LimitWordCount(50), pretty much as in the tutorials. The only problem is that links shows as link[link/] and not as regular links. I'm sure thats there is a solution to this, but I can't figure it out...


Forum Moderator, 5523 Posts

1 October 2007 at 7:49pm

try Summary instead of LimitWordCount. Summary(50) - Returns the maximum number of complete sentences that are less than 50 words, up to the first paragraph.


49 Posts

1 October 2007 at 9:28pm

Edited: 01/10/2007 9:29pm

If I use Summary(50) I get this error message:

XML-tolkningsfel: felmatchad tagg. Förväntat: </li>.
Adress: http://localhost/moks_public/startsida/?flush=1
Radnummer 65, Kolumn 1682:

It's swedish. For those who don't speak swedish it's expecting </li> but Summary() seems to put in a couple of </br>-s which messes things up.


Community Member, 501 Posts

2 October 2007 at 11:40am

Summary worked for me, only I'm not noticing any difference between Summary and FirstParagraph, no matter what value I'm giving Summary... it always gives the first paragraph.

I'm having trouble understanding 'the maximum number of complete sentences that are less than x words'. I don't see a difference between 5 or 50..


49 Posts

2 October 2007 at 6:39pm

With FirstParagraph I don't get any error messages, but links in the snippets still don't get "clickable". They still show up as "link[/link]". hmm...


49 Posts

3 October 2007 at 1:59am

Ok, nevermind. With some help from the friendly people on irc I found out that this was, as so many times before, my bad.

I recommend Summary if you want proper links in a situation like this, it works just fine. Case closed.