Well, my entire plugin was a whopping 20 lines, but yeah, this 

[% listing.description | truncate(20) %]

is perfect for me.

Yeah, a friend here at work actually has the book, and I have been borrowing
it for weeks, but just haven't taken time to read it with much diligence.  I
have been through much of the docs online, but guess I missed my new best
friend, truncate.  Or maybe just thought, well, I could do that in 20 lines
if I ever really needed to :)

Thanks,
Earl


> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:templates-
> [EMAIL PROTECTED]
> Sent: Tuesday, March 15, 2005 2:29 PM
> To: [email protected]
> Subject: Re: [Templates] a little text formatting
> 
> On Tue, Mar 15, 2005 at 02:24:14PM -0700, Cahill, Earl wrote:
> > Wow, it even uses '...' by default.  I am not a huge fan of filters
> though,
> > just cause of the need of an [% END %].o
> 
> Then you want to embed the filter in the line of your variable.
> 
> [% MyText FILTER truncate(25) %]  # MyText is your variable holding text
> 
> Or the more compact
> [% MyText | truncate(25) %]
> 
> Of course, that won't help you if your text is not in a variable.
> 
> --
> Brett Sanger/Swiftone
> [EMAIL PROTECTED]
> 
> _______________________________________________
> templates mailing list
> [email protected]
> http://lists.template-toolkit.org/mailman/listinfo/templates

_______________________________________________
templates mailing list
[email protected]
http://lists.template-toolkit.org/mailman/listinfo/templates

Reply via email to