Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Alias (5735)

  (email not shown publicly)

Journal of Alias (5735)

Wednesday May 25, 2005
04:43 AM

Template::Plugin::NakedBody and Perl::Squish!

[ #24872 ]

Now really, how could anybody resist a headline like that!

In my periodic quest to make the editing of Template Toolkit templates simple for "designers" and sane for the rest of us, I decided I wanted to be able to have included fragments of pages properly editable by designers, with full stylesheets and everything.

And I wanted to do it without having having ugly <!-- [% -->header<!-- %] --> having to be dumped all over the place.

Template::Plugin::NakedBody is a filter which you use like [% INCLUDE page_fragment.html | NakedBody %] and which strips away the header gumph leaving only the raw body.

Time will tell if adding | NakedBody to each include is more maintainable than adding tags to each fragment, but at least designers are WAY less likely to break the filter calls as they go about their work.

I've also written up a article for the 9th of June demonstrating a basic use of PPI. The module that accompanies the talk, Perl::Squish, should be up on CPAN shortly.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.