PDA

View Full Version : dots at end of string


ejmo
14-01-09, 07:45
Hi, does anyone know where to remove the three added dots that appear on the end of a truncated string (...) in version 1.


Thanks, Phil

Andy
14-01-09, 14:32
The dots are there to convey the fact that the string is truncat...

removing them could mean your users aren't aware that the string has been trunca

But you didnt ask for advice, you asked for a solution, so here it is:

ShopWindow V1 + V2:
in: includes/smarty/libs/plugins/modifier.truncate.php
first line of php (line 27, unmodified file):
function smarty_modifier_truncate($string, $length = 80, $etc = '...',
change to
function smarty_modifier_truncate($string, $length = 80, $etc = '',
Basically, you're setting the $etc variable to nothing, but keeping it set so as not to interfere with the rest of the function.
You could set it to anything you liked, eg:
function smarty_modifier_truncate($string, $length = 80, $etc = 'AnythingYouLike',
and you'd get a truncated string like:
"this string has been truncaAnythingYouLike"

ejmo
14-01-09, 15:29
Hi, thanks, that is just what I wanted. I am using a truncated string for seo and the dots were cocking it up. I take your point about visitors expecting to see them.

Cheers, Phil.