Jump to:

17452 Posts in 4473 Topics by 1971 members


SilverStripe Forums » Archive » $Content.FirstParagraph

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: 2796 Views
  • Decisive Flow
    Community Member
    73 Posts

    $Content.FirstParagraph Link to this post

    I have been told this is hard to do but we would love it if the addition of .FirstParagraph didn't remove all styling/images/links and turn it all into boring text! I've had the opposite problem with Joomla and realise the issues with tags closing and not closing and breaking pages, but some kind of fix would be awesome

  • Sam
    679 Posts

    Re: $Content.FirstParagraph Link to this post

    Good call. We could probably look for matching tags to ensure that we didn't break XHTML validity.

    Should the output include the <p> tag, though, or should we force designers to add that themselves? Removing them would give more control over the output, but you might wind up writing <p>$Content.FirstParagraph</p> all the time, which would get a bit annoying.

    Ie, should $Content.FirstParagraph return this:
    <p>My <b>styled</b> paragraph</p>

    Or this?
    My <b>styled</b> paragraph

  • Hayden
    Core Development Team
    19 Posts

    Re: $Content.FirstParagraph Link to this post

    This has been improved for the HTMLText field type in the latest version.

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.