prestamax Posted February 10, 2014 Share Posted February 10, 2014 I want to allow line breaks in the product short description. How can I achieve this?I have tried to change {$product.description_short|strip_tags:'UTF-8'|truncate:360:'...'} to {$product.description_short|strip_tags:'<br>'|truncate:360:'...'} but this doesn't work. Does anybody know a solution? Thanks in advance. Link to comment Share on other sites More sharing options...
vekia Posted February 10, 2014 Share Posted February 10, 2014 remove |strip_tags modifier but be aware! your descriptions must be shorter than 360 otherwise it will leave html tags unclosed! 1 Link to comment Share on other sites More sharing options...
prestamax Posted February 11, 2014 Author Share Posted February 11, 2014 Thanks vekia, this is why I hoped that there was an option to allow br tags and strip all other tags. But if there is no other way I will remove the strip_tags modifier. Link to comment Share on other sites More sharing options...
vekia Posted February 11, 2014 Share Posted February 11, 2014 strip_tags works the same as php strip_tags function. strip_tags — Strip HTML and PHP tags from a string so it removes all html tags from string, also <br> this is why it's necessary to remove it and in fact, there is no other way to allow <br> - just remove this modifier.. Link to comment Share on other sites More sharing options...
El Patron Posted February 11, 2014 Share Posted February 11, 2014 please note when making changes to product short descriptions that you check your sitemap and other seo crawls so they do not get messed up. There is a reason why short desc does not allow html code. Link to comment Share on other sites More sharing options...
idoityourself Posted October 4, 2014 Share Posted October 4, 2014 What about in the more info section? Id like to add some line breaks in there so its not one big mass of text Link to comment Share on other sites More sharing options...
Recommended Posts