OT: Templating systems (was RE: [Catalyst] New default screen for Catalyst)

Andrew Ford A.Ford at ford-mason.co.uk
Thu Oct 20 18:46:47 CEST 2005

Nigel Metheringham wrote:

>On Wed, 2005-10-19 at 10:41 -0400, Thomas, Mark - BLS CTR wrote:
>>Personally, I don't see how HTML::Template is any different from how I
>>use TT, except:
>>3. Your HTML templates cannot be validated as proper HTML.
>Actually you can, as long as you use the alternative form of tags where
>they are embedded in <!-- --> comments.
When I am dealing with TT templates that others are going to edit with 
dreamweaver I set my tags to:

    START_TAG => qr{(?:\[|<!--\s*)%}
    END_TAG   => qr{%(?:\s*-->|\])}

This allows me to put comments in places like tables, like so:

    <!--% FOREACH row IN rows %-->
    <tr><td>... </td></tr>
    <!--% END %-->

and have the page source validate.  I can use standard [% / %] tags in 
textual element content too if I want.

I also think that code like:

    <!--% name = "foo" %-->

stands out more in the HTML source than:


IMO the magic incantation (<!--% and %-->) is more distinctive than 


Andrew Ford,  Director    Pauntley Prints / Ford & Mason Ltd            
A.Ford at ford-mason.co.uk   South Wing Compton House                      
pauntley-prints.co.uk     Compton Green, Redmarley  Tel: +44 1531 829900
ford-mason.co.uk          Gloucester GL19 3JB       Fax: +44 1531 829901
refcards.com cronolog.org Great Britain          Mobile: +44 7785 258278

More information about the Catalyst mailing list