Tabber with "Only Displaying the First Ten Words..." patch
Posted: Sat Mar 15, 2014 1:45 pm
To omit the {TAB NAME} stuff inadvertently showing when using the Advanced Guide Only Displaying the First Ten Words... on things like New Product, Best Sellers, etc - use this instead of the Advanced Guide code:
This puts a <br> tag where every tab header would have been so each tab content appears on a new line.
Code: Select all
<actinic:block php="true" >
$sShort = "";
$nCount = 0;
$sOriginal = '<actinic:variable encoding="perl" name="ProductDescription" selectable="false" />';
$newstring = preg_replace('/(\{|{)(.*?)(}|\})/s', '<br>', $sOriginal);
foreach(explode(" ", $newstring) as $sWord)
{
if ($nCount > 10)
{
$sShort .= "...";
break;
}
$sShort .= $sWord . " ";
$nCount++;
}
echo $sShort;
</actinic:block>