Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » How to get links with LimitWordCount?

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

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

Page: 1
Go to End
Author Topic: 2648 Views
  • Reflektera
    Avatar
    49 Posts

    How to get links with LimitWordCount? Link to this post

    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...

  • Willr
    Avatar
    Forum Moderator
    5489 Posts

    Re: How to get links with LimitWordCount? Link to this post

    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.

  • Reflektera
    Avatar
    49 Posts

    Re: How to get links with LimitWordCount? Link to this post

    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.

  • dio5
    Avatar
    Community Member
    501 Posts

    Re: How to get links with LimitWordCount? Link to this post

    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..

  • Reflektera
    Avatar
    49 Posts

    Re: How to get links with LimitWordCount? Link to this post

    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...

  • Reflektera
    Avatar
    49 Posts

    Re: How to get links with LimitWordCount? Link to this post

    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.

    2648 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.