Search content leaving image paths

Deann Graham asked on August 1, 2016 19:39

Have any of you used the transformation to strip the html from the content only to see an image path as content? How do I get rid of the images from the content?

<%# SearchHighlight(HTMLHelper.HTMLEncode(TextHelper.LimitLength(HttpUtility.HtmlDecode(HTMLHelper.StripTags(CMS.ExtendedControls.ControlsHelper.RemoveDynamicControls(GetSearchedContent(DataHelper.GetNotEmpty(Eval("Content"), ""))), false, " ")), 280, "...")), "<strong>", "</strong>") %>

Returns this: Five Behaviors based on Everything Disc ~/Fb2/media/FiveBehaviorsMedia/imgs/product-box-ED.png The Five Behaviors of a Cohesive Team™ powered by Everything DiSC® helps teams understand how to apply The Five Behaviors™ model of Trust, Conflict, Commitment, Accoun...

Recent Answers


Trevor Fayas answered on August 1, 2016 22:03

This can be an issue indeed. What i've had to do in the past is to make a custom method that cleans up the HTML in a better way than HttpUtility.HtmlDecode().

0 votesVote for this answer Mark as a Correct answer

Boris Pocatko answered on August 2, 2016 03:48

I'd also try to check with support if this isn't actually a bug.

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on August 2, 2016 03:58

Check to see if the field marked as content in the Page type Search definition has an image link in it or HTML. Technically the StripTags() function should remove this but it may require some tweaking. I don't believe it is a bug at all, I believe it has everything to do with content.

Image Text

0 votesVote for this answer Mark as a Correct answer

Deann Graham answered on August 2, 2016 16:38

Yeah.. it is an editable text box that has an image. Or a page that has an editable image. The striptags is hitting the "" and keeping the src path intact.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.