RE: [Templates] a little text formatting

[prev] [thread] [next] [Date index for 2005/03/15]

From: Cahill, Earl
Subject: RE: [Templates] a little text formatting
Date: 21:42 on 15 Mar 2005
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: templates-admin@xxxxxxxxxxxxxxxx.xxx [mailto:templates-
> admin@xxxxxxxxxxxxxxxx.xxx]
> Sent: Tuesday, March 15, 2005 2:29 PM
> To: templates@xxxxxxxxxxxxxxxx.xxx
> 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
> Swiftone@xxxxxxxx.xxx
> 
> _______________________________________________
> templates mailing list
> templates@xxxxxxxxxxxxxxxx.xxx
> http://lists.template-toolkit.org/mailman/listinfo/templates

_______________________________________________
templates mailing list
templates@xxxxxxxxxxxxxxxx.xxx
http://lists.template-toolkit.org/mailman/listinfo/templates

[Templates] a little text formatting
Cahill, Earl 21:09 on 15 Mar 2005

Re: [Templates] a little text formatting
Darren Chamberlain 21:16 on 15 Mar 2005

Re: [Templates] a little text formatting
Larry Leszczynski 21:17 on 15 Mar 2005

RE: [Templates] a little text formatting
Cahill, Earl 21:24 on 15 Mar 2005

Re: [Templates] a little text formatting
Darren Chamberlain 21:23 on 15 Mar 2005

Re: [Templates] a little text formatting
Brett Sanger 21:29 on 15 Mar 2005

Re: [Templates] a little text formatting
Darren Chamberlain 21:28 on 15 Mar 2005

RE: [Templates] a little text formatting
Cahill, Earl 21:42 on 15 Mar 2005

RE: [Templates] a little text formatting
Jason Gottshall 22:38 on 15 Mar 2005

Generated at 16:59 on 18 Mar 2005 by mariachi v0.52