Asset listing News Item using body attribute


(Clementoke) #1

Hi all,

I'm using keywords to pull a maximum of 250 characters from the body attribute of a News Items into a listing but it pull it in as HTML and I get unstuck if a hyperlink is within that range. What it does is include the code which breaks up my page.

Any ideas on how to just get the text and not the HTML characters from the body attribute?

Cheers,

Clement


(Tbaatar) #2

Have you tried using the keyword modifier to strip the html?

%asset_attribute_description^striphtml%

 

 

Edit: If your already using keyword modifier to limit the the characters to 250, then you can chain it:

 

%asset_attribute_description^striphtml^maxchars:250%

 

You could also try escapehtml


(Clementoke) #3

Works a treat. Cheers