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.

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

Display Summary Content (How to Parse Out Images)


Go to End


2 Posts   1979 Views

Avatar
edk

Community Member, 39 Posts

11 June 2010 at 9:10am

I have run into this in two places now. In a search result summary and also in Blog Summary. Here is the scoop:

When a content editor places an Image to be the first item in the Content Window in the WYSISWYG, when you try and use one the of the methods like $Content.Summary() etc...it does not really act as you may like. I have toyed with the idea of a new method that would parse out the <img> or a <div> etc...

Has anyone else run into this issue? What did you do for a solution.

Thanks,
Ed

PS: For the blog as a quick work-around I created a new field call "Excerpt". This is manual solution on the part of the content editor though as they would have to complete the field. This solution doesn't work for the Search Results though.

Avatar
Willr

Forum Moderator, 5523 Posts

11 June 2010 at 7:18pm

You can use the <% control Content %>$Summary.NoHTML<% end_control %> which strips out all HTML. This works well in search results to remove all formatting (headers etc)