Good afternoon PerlMongers and TriLUGgers, Thursday evening Mike South will give a talk on the subject of writing custom plugins and filters for Template Toolkit.
The meeting will take place at McClatchy Interactive at 7:15pm. Directions are available on our website at http://raleigh.pm.org/ We hope to see you there! --bradoaks On 9/13/05, Mike South <[EMAIL PROTECTED]> wrote: > Hi, > > The good news is that Brad has really been working diligently efforts > to get a talk this month, and he's got commitments for two! The bad > news is that they are in October and November. > > But the really bad news is that I'm volunteering to fill in for this > month by following up our earlier Template Toolkit adventure with a > look at Template::Plugin and Template::Plugin::Filter. > > Last time we tried to have a talk with Template Toolkit as the topic, > we postponed the meeting due to ice. Let's see if it's a bona-fide > jinx--maybe the mere act of setting this up for Thursday will bring > the hurricane our way. > > I'm not officially announcing this, because I don't know exactly > whether we have committed to different locations or whatever. I > assume we will be doing this at McClatchy Interactive offices, but > wait for the followup official announcement before you set coordinates > into your GPS units. > > About Template Toolkit, and its plugin and filter stuff: > > Template Toolkit is a powerful, fast, flexible templating system which > is also extensible. Two of the most common tools for extension are > Template::Plugin and Template::Plugin::Filter. One of the > constructions in template toolkit is a filter block: > > [% FILTER html_para %] > When you see this, it will have paragraph tags > where I only had double newlines. > > Isn't that special? > [% END %] > > The output of that block will have opening and closing p tags around > the double newline delimited paragraphs. Suppose you wanted to add > the capability of adding a css class to the paragraph tag (not that I > know if a css class belongs there, but pretend it does). You could > create your own filter that does that, allowing you to do something > like this: > > [% FILTER classy_html_para( class=>'red_and_blinking') %] > When you see this, it will have paragraph tags > where I only had double newlines. > > Isn't that special? > [% END %] > > Plugins are just general ways to get something into your template. > Existing plugins will get you a DBI connection handle, or access to > CGI.pm methods for example. Writing your own plugins allows you to > do, well, whatever the heck you want. > > What I'm planning to do is show you how to write Plugin and Filter > modules and give a couple of examples of what I've done with them. > Most importantly I'll go over the annoying little gotchas that you are > likely to run into the first time you roll your own. > > Look for the real announcement with location, directions, etc. shortly. > > mike > _______________________________________________ > Raleigh-pm mailing list > [EMAIL PROTECTED] > http://mail.pm.org/mailman/listinfo/raleigh-pm > -- TriLUG mailing list : http://www.trilug.org/mailman/listinfo/trilug TriLUG Organizational FAQ : http://trilug.org/faq/ TriLUG Member Services FAQ : http://members.trilug.org/services_faq/ TriLUG PGP Keyring : http://trilug.org/~chrish/trilug.asc
