Invision Community 4: SEO, prepare for v5 and dormant account notifications Matt November 11, 2024Nov 11
Posted April 3, 20168 yr I might have something wrong here. I'm trying to strip the HTML from a blog article and only show 200 characters. It seems to work but I get strange characters. What did I do wrong? {{$trimmedValue = strip_tags($entry->content()|raw, "<p><div><span><br><hr><b><i><em><strong><img>"); }} {{$trimmedValue = substr($trimmedValue, 0, 200); }} {$trimmedValue} <a href="{$entry->url()}">Read More</a>
April 4, 20168 yr Not sure why you have $entry->content()|raw, raw is usually used with the templates. Try taking the |raw out and see if that doesn't fix the problem.
April 5, 20168 yr Author 22 hours ago, Hulu said: Not sure why you have $entry->content()|raw, raw is usually used with the templates. Try taking the |raw out and see if that doesn't fix the problem. Thanks. Removing the raw did correct the issue. Not fully understanding why it worked. The raw produced all the content in raw format, including the HTML tags.
October 16, 20168 yr Was facing the same problem. The reason why |raw actaully breaks it is because if you execute pure PHP this runs outside the IPS code framework for template output
Archived
This topic is now archived and is closed to further replies.