Re: [SMARTY] truncate problem

From: Date: Tue, 15 Oct 2002 22:35:11 +0000
Subject: Re: [SMARTY] truncate problem
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-6170@lists.php.net to get a copy of this message
JvV> I recently started using smarty and I seem to have a problem with the JvV> truncate option. JvV> This is the line that I have in the template: JvV> {$sublinks[name]|truncate:120:"..."} JvV> Yet my output is everything but this: JvV> http://www.honden.be/beta JvV> The first problem I encountered was that It didn't cut off after the amount JvV> of characters I wanted (which was 40), only by upping it to 120 I got more JvV> or less the result I wanted. Besides this, I'm not getting the trailing JvV> '...' as I specified. Any html chars in your string ? If what is displayed is lets say " " and you try to truncate to 3, you might not get the expected result since the real string might be &&"&& otherwise, just add some debug code to plugins/modifier.truncate.php to point out what's going wrong. As far as i know, truncate works well in 2.3.0 Bertrand

« previous php.smarty.general (#6170) next »