Forums / Templates, Stylesheets, Page Layout / Truncate product names to 1 line

Truncate product names to 1 line

Locked

Views: 659

Results 1 to 3 of 3
This thread is locked. New replies are disabled.
17 Sep 2010, 12:22 PM
#1
i_q avatar

i_q

New Zenner

Join Date:
Jan 2006
Posts:
23
Plugin Contributions:
0

Truncate product names to 1 line

Some of my product names are going onto 2 lines on the front page and this is throwing the dimentions of the boxes off so they look out of place. Does anyone know how to truncate these to use only 1 line?

I am using a custom template and zen casrt 1.3.8a.

Many thanks,

Al

17 Sep 2010, 9:46 PM
#2
terragirl avatar

terragirl

Zen Follower

Join Date:
Jun 2010
Location:
Austria
Posts:
123
Plugin Contributions:
0

Re: Truncate product names to 1 line

You can modify the length via PHP:

substr($s,0,$m)

where $s is your title, 0 means from the start and $m should be the number of characters you wish to show.

PHP function explained here: http://uk3.php.net/manual/en/function.substr.php


Alternatively, you could use CSS to fix the height & width and set overflow to hidden which will then effectively hide the text although it will still show in the page source.

17 Sep 2010, 10:12 PM
#3
i_q avatar

i_q

New Zenner

Join Date:
Jan 2006
Posts:
23
Plugin Contributions:
0

Re: Truncate product names to 1 line

Thanks for that. Would you happen to know which file I would need to edit for this?

Many thanks.