Skip Menu |

This queue is for tickets about the HTML-Template-Compiled CPAN distribution.

Maintainer(s)' notes

Note: there is a bug with caching and TMPL_INCLUDE_VAR since 0.97_004 until 0.98. either use an earlier version or upgrade to 0.98_001. Another workaround is to precompile all templates to file_cache_dir. The bug happens when including a template via INCLUDE_VAR and the template is not yet compiled or has changed.

I'm sorry if the change about aliases came quite unannounced. I didn't expect any problems since dollar signs are not allowed in template vars, but I heard from at least one case where people were doing exactly this.
Please do not use unallowed characters in template vars. Allowed are (from the HTML::Template::FAQ): Numbers, letters, '.', '/', '+', '-' and '_'.
This should work in HTML::Template::Compiled::Classic.
in HTML::Template::Compiled you should be only using numbers, letters and _.
The dot, for example, is special. If you need to get a hash key from the template parameters with special charcaters, you can try <tmpl_var _.$var$name$with$dollars >

There will be a workaround in the next version:
local $HTML::Template::Compiled::Compiler::DISABLE_NEW_ALIAS = 1;


Please report any bug you find.
The code is now hosted on https://github.com/perlpunk/HTML-Template-Compiled
If you have a bug report, you can also post it there in the "Issues" section.
In the bugreport, please include, if possible, the module version, perl version and a testcase that reproduces the error; that makes it easier to find the bug.

The issue with not reloading includes of includes should be fixed in version 0.95_003. If you have any problems though please report!

Using query() and the dot syntax might not work together always. If you have a tmpL_var name="..foo" (going up the stash one level) the var foo is not detected and will not be reported by the query() function. Since the dot syntax is for dereferencing hashes and method calls the query function might not make sense anyway. I believe it is a bad idea to let the program do things if the template is using a certain variable.

Thanks!

Report information
The Basics
Id: 76072
Status: resolved
Priority: 0/
Queue: HTML-Template-Compiled

People
Owner: Nobody in particular
Requestors: info [...] gwendragon.de
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 0.96
Fixed in: 0.96_002



Subject: Enhancement request - Chomping newlines from tags with easier syntax
My wish: Chomping of newlines (before, after, both) from tags. Template tags should not automatically generate newlines. I hope i didnt misunderstood the use of chomp mode im HTC. A global setting could be done with attributes like tagchomp, tagchomppre and tagchomppost (or some other name for the attribute). For example this could be set with: $htc->new( tagchomp => 1); # global setting Now lets step towards the problem within templates. I think three different cases are existing in templating with newlines: a) Remove all newlines from tags ---- <?IF Foo CHOMP=1?> Booh! <?/IF?> . ---- Should generate: ---- Booh! . ---- b) Remove previous newline ---- <?IF Foo CHOMPPRE=1?> Booh! <?/IF?> . ---- Should generate: ---- Booh! . ---- c) Remove follwoing newlines ---- <?IF Foo CHOMPPOST=1?> Booh! <?/IF?> . ---- Should generate: ---- Booh! . ---- The names of the chomp... parameter could be CHOMP, CHOMPPRE and CHOMPPOST. The current chomp method in HTC with syntax <+-%, <--% is so confusing, ugly and breaks with the common starting tag delimiter <% and some webeditors are very confused by <+- or even <-- syntax. Thanks in advance for adding my wish in new HTC release.
Hi, I have implemented it now like in Template-Toolkit. See documentation in version 0.96_002 Only the constructor example is wrong: my $htc = HTML::Template::Compiled->new( PRE_CHOMP => 0, # 0, 1, 2, 3, default 0 POST_CHOMP => 1, # 0, 1, 2, 3, default 0 ); should be lowercase: my $htc = HTML::Template::Compiled->new( pre_chomp => 0, # 0, 1, 2, 3, default 0 post_chomp => 1, # 0, 1, 2, 3, default 0 ); I removed the previous experimental tagstyles.
From: info [...] gwendragon.de
Am So 22. Apr 2012, 13:40:33, TINITA schrieb: Show quoted text
> I have implemented it now like in Template-Toolkit. See documentation > in version 0.96_002
pre_ and post_comp runs fine, as wished. Show quoted text
> I removed the previous experimental tagstyles.
Good idea. Thanks a lot for the enhancement!