Jump to content

Products name length / 2 lines


Recommended Posts

hello devel!

1. for changing product's name lenght in categories go to:

/public_html/themes/your theme/product_list.tpl and search for:

{$product.name|truncate:32:'...'|escape:'htmlall':'UTF-8'}

change truncate(this is the number of characters) into what number you need.

 

2. for changing product's name on first page "homefeatured block" go to:

 

/public_html/themes/your theme/modules/homefeatured/homefeatured.tpl and search for:

 

title="{$product.name|truncate:32:'...'|escape:'htmlall':'UTF-8'}

 

change truncate number as you need

  • Like 3
  • Thanks 1
Link to comment
Share on other sites

  • 6 months later...
  • 3 months later...

hello devel!

1. for changing product's name lenght in categories go to:

/public_html/themes/your theme/product_list.tpl and search for:

{$product.name|truncate:32:'...'|escape:'htmlall':'UTF-8'}

change truncate(this is the number of characters) into what number you need.

 

2. for changing product's name on first page "homefeatured block" go to:

 

/public_html/themes/your theme/modules/homefeatured/homefeatured.tpl and search for:

 

title="{$product.name|truncate:32:'...'|escape:'htmlall':'UTF-8'}

 

change truncate number as you need

 

 

this was very useful to me! It finally worked. Thanks.

Link to comment
Share on other sites

  • 10 months later...
  • 1 month later...
  • 1 month later...

everything depends on your theme.

you have to increase height of product name object (div/span whatever)

 

If I want to add two lines to my home page products, I have to change homefeatured.tpl?

 

Do I have to add span/div for height? Where exactly can I change it:

 

 <li class="ajax_block_product "> <a class="product_image" href="{$product.link}" title="{$product.name|escape:html:'UTF-8'}" class="product_image"> <img src="{$link->getImageLink($product.link_rewrite, $product.id_image, 'home_default')}"  alt="{$product.name|escape:html:'UTF-8'}" /> </a>
      <h5><a  class="product_link" href="{$product.link}" title="{$product.name|truncate:50:'...'|escape:'htmlall':'UTF-8'}">{$product.name|truncate:25:'...'|escape:'htmlall':'UTF-8'}</a></h5>
      {if $product.show_price AND !isset($restricted_country_mode) AND !$PS_CATALOG_MODE}
Link to comment
Share on other sites

 

If I want to add two lines to my home page products, I have to change homefeatured.tpl?

 

 

two lines of? of products?

if so, just define highest / lowest product number on module configuration page (modules > modules > homefeatured > configure)

product list will be splitted to two lines then.

 

 

 

Do I have to add span/div for height? Where exactly can I change it:

in css styles (homefeatured.css) - height param for <li> object.

Link to comment
Share on other sites

  • 9 months later...

Previous for me is truncate:25

NOW i change to truncate:55

Solved for me 1.5.6.1 here

1. for changing product's name lenght in categories go to:
/public_html/themes/your theme/product_list.tpl and search for:
{$product.name|truncate:32:'...'|escape:'htmlall':'UTF-8'}change truncate(this is the number of characters) into what number you need.

 

Solved for me 1.5.6.1 here www.7zhop.com

Link to comment
Share on other sites

  • 1 month later...
  • 1 year later...

two lines of? of products?

if so, just define highest / lowest product number on module configuration page (modules > modules > homefeatured > configure)

product list will be splitted to two lines then.

 

in css styles (homefeatured.css) - height param for <li> object.

Sorry what is needed exactly to do in css file for increase the white lines of title also if they are short than the truncate ?

 

All titles need to keep the same number of lines also if they are short.

 

Product list now, in grid mode, seems setted by default at 2 lines becouse products also if they have one line they keep 2. How i can increase that to three ?

 

Thanks

Edited by Derres (see edit history)
Link to comment
Share on other sites

  • 1 year later...
  • 4 years later...
  • 6 months later...

 

I increased the truncate from 30 to 40, and added style for div's height. Not a good solution but simple.

.../miniatures/product.tpl

<div class="product-description" style="height:60px;">
        {block name='product_name'}
          {if $page.page_name == 'index'}
            <h3 class="h3 product-title"><a href="{$product.url}" content="{$product.url}">{$product.name|truncate:40:'...'}</a></h3>
          {else}
            <h2 class="h3 product-title"><a href="{$product.url}" content="{$product.url}">{$product.name|truncate:40:'...'}</a></h2>
          {/if}
        {/block}

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...