Mr.Curiosity Posted June 11, 2011 Share Posted June 11, 2011 in my 1st products, the product title row is 3 because the product name is too long, which make the overall look crampy.I want to limit the maximum row of my product title to just 2 row.I want it to look like something like my product description, when the text is too long, it will shows "..." , instead of having more row.this is my blocknewproducts.tpl <!-- MODULE Block new products --> {l s='New Products' mod='blocknewproducts'} {if $new_products|@count > 0} {foreach from=$new_products item=newproduct name=myLoop} getImageLink($newproduct.link_rewrite, $newproduct.id_image, 'medium')}" alt="{$newproduct.legend|escape:htmlall:'UTF-8'}" />{$newproduct.name|strip_tags|escape:htmlall:'UTF-8'} {t text=$newproduct.description_short length='25' strip='true' encode='true'} {if !$priceDisplay || $priceDisplay == 2} {convertPrice price=$newproduct.price}{if $priceDisplay == 2} {l s='+Tx' mod='blocknewproducts'}{/if}{/if} {if $priceDisplay} {convertPrice price=$newproduct.price_tax_exc}{if $priceDisplay == 2} {l s='-Tx' mod='blocknewproducts'}{/if}{/if} {/foreach} {else} {l s='No new products at this time' mod='blocknewproducts'} {/if} <!-- /MODULE Block new products --> Link to comment Share on other sites More sharing options...
shokinro Posted June 11, 2011 Share Posted June 11, 2011 please replace following code {$newproduct.name|strip_tags|escape:htmlall:'UTF-8'} with this coce {$newproduct.name|truncate:80:'...'|strip_tags:'UTF-8'} Please note: you need to adjust the number 80 (length) to meet your own needs.hope this helps Link to comment Share on other sites More sharing options...
Mr.Curiosity Posted June 11, 2011 Author Share Posted June 11, 2011 thank you, it works.. and know I understand what truncate is about. Link to comment Share on other sites More sharing options...
shokinro Posted June 11, 2011 Share Posted June 11, 2011 thank you, it works.. and know I understand what truncate is about. it will truncate the content if the content is longer than the specified number of length.please mark is as solved if you think it solved your problem. Link to comment Share on other sites More sharing options...
Recommended Posts