Jump to content

[Solved] how to limit the display of maximum row of text


Recommended Posts

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 --> 

47133_nL71mbUS6W16YmdvElcP_t

Link to comment
Share on other sites

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

×
×
  • Create New...