Phil wrote:
This might help others. It does the trick.
I have added the little hack in the listing_img_title file between end of product name and product price.
it displays 175 caracters from the regular description and replace last space by '...' and Read More.
you can manage class 'shortdesc' has you want.
I'm not pro so the hack can certainly be improved.
<!-- description -->
<div class="shortdesc">
<?php
$maxLength = 175;
$longDesc = $this->row->product_description;
if (strlen($longDesc)>$maxLength){
$longDesc = substr($longDesc, 0, $maxLength);
$position_espace = strrpos($longDesc, " ");
$longDesc = substr($longDesc, 0, $position_espace);
$longDesc = $longDesc." ... ";
}
echo $longDesc;
echo '<a href="'.$link.'">Read more</a>';
?>
</div>
<!-- EO description -->
I use this code
<!-- description-->
<div class="shortdesc">
<?php
$maxLength = 90;
$longDesc = $this->row->product_description;
if (strlen($longDesc)>$maxLength){
$longDesc = substr($longDesc, 0, $maxLength);
$position_espace = strrpos($longDesc, " ");
$longDesc = substr($longDesc, 0, $position_espace);
$longDesc = $longDesc." ... ";
}
echo $longDesc;
?>
</div>
And it works great.
Is any way to strip html tags?
Now if there is <strong> tag in first scentence and if it not closed before character limit, all site from there is bold.