Developer forum

Forum » CMS - Standard features » StripHtml() not working on solution

StripHtml() not working on solution

Hans Ravnsfjall
Reply

Hi

I have a solution where i try to remove the html format, using StripHtml()

the code looks like this <!--@ItemPublisher:Item.Text.Value.StripHtml().Crop(100)-->

But its not working :( What is wrong?

 

the page is here, and the failiure is on the left bottom newslist

http://bfl2015.net.dynamicweb-cms.com/bokadeild-foeroya-laerarafelags

 

 

bfl_striphtml.jpg

Replies

 
Nicolai Høeg Pedersen
Reply
This post has been marked as an answer

Strip html removes the html tags - <>, so that is fine. Problem is when you crop, you end up in a string that is html encoded. So you should be able to decode before cropping.

So do like this:<!--@ItemPublisher:Item.Text.Value.StripHtml().HtmlDecoded().Crop(100)-->

Votes for this answer: 1
 
Hans Ravnsfjall
Reply

That´s perfect Nicolai thanx :)

 

You must be logged in to post in the forum