A new question for you! I have a feed that has the <br> or <br />
tags in it. I want to allow line breaks because otherwise the product description gets jumbled up a bit. I know that the tapestry and normalize functions get rid of HTML code. Is there anyway that I can allow just that one tag to be allowed in the description field?
Thanks for any ideas!
-Joe
Hi David,
Works great and connected a synapse in my brain! haha ;)
Seriously it did make me realize a lot about the PHP filter, so thanks!
-Joe
Hi David ,
I've been looking to do this as some products on my site have stupidly long text that is meant to be broken up into sections. I can't find the part that you mention anywhere though for me to change this. I'm assuming it's because I have a newer version, so how would this be done now please?
Thanks
Ben
Hi Ben,
The latest distribution doesn't strip tags automatically as there is now a Strip HTML filter available is HTML needs to be removed from the description; so it sounds as if your long descriptions don't have HTML in place otherwise they should display correctly.
Is there any indication in the description as to where line breaks (paragraphs) should be inserted?
Cheers,
David.
--
PriceTapestry.com
Hi Joe,
Sure - the strip_tags call can be modified to permit BR, and then after that, the < > and / symbols must be allowed by the normalise function. To do this, look for the following code beginning at line 161 of includes/admin.php
if ($admin_importFeed["field_description"])
{
$record[$admin_importFeed["field_description"]] = strip_tags($record[$admin_importFeed["field_description"]]);
$record[$admin_importFeed["field_description"]] = tapestry_normalise($record[$admin_importFeed["field_description"]],",'\'\.%!");
}
...and REPLACE this with:
if ($admin_importFeed["field_description"])
{
$record[$admin_importFeed["field_description"]] = strip_tags($record[$admin_importFeed["field_description"]],"<br>");
$record[$admin_importFeed["field_description"]] = tapestry_normalise($record[$admin_importFeed["field_description"]],"<>\/,'\'\.%!");
}
Cheers,
David.