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've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Archive /

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

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

$Content.FirstParagraph


Go to End


3 Posts   3772 Views

Avatar
Decisive Flow

Community Member, 73 Posts

13 November 2006 at 10:38am

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 :)

Avatar
Sam

Administrator, 690 Posts

13 November 2006 at 10:51pm

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

Avatar
Hayden

Core Development Team, 19 Posts

30 January 2007 at 3:34pm

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