Robert Hicks <[EMAIL PROTECTED]> writes:

> Paul Seamons wrote:
>> Text::Tmpl has a COMMENT directive.  Both to
>> enhance cross compatibility as well as to add features, it
>> would be nice for TT to support this directive.  It would
>> most likely have to be added at the TT3 release.
>>
>> Template::Parser::CET and Template::Alloy support it currently.
>>
>>   [% COMMENT %]
>>
>>      Template section that won't be shown
>>      [% var_a %]
>>      [% IF foo %]Foo[% END %]
>>
>>   [% END %]
>>
>> Paul Seamons
>
> Do you mean this to be something analogous to Javadoc? Otherwise there
> is already a way to comment stuff with [%# %]. What do you mean by
> "cross compatibility"?
>
> [%#
>       Template section that won't be shown
>       [% var_a %]
>       [% IF foo %]Foo[% END %]
> %]

No, that won't do: The comment '[%#' ends with the *first* '%]' it
encounters, there's no concept of nested tags (at least in TT2).

I've been bitten by that occasionally when I tried to comment out
bigger sections in templates.  A workaround for the page appearance is
to [% FILTER redirect("/dev/null") %], but it is really just a
*workaround* since included directives will be processed by TT (same
for the other workaround to embed in HTML comments, for web output).

So a comment block would add something I could have used sometimes in
the past.
-- 
Cheers,
haj

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

Reply via email to