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: 46509
Status: resolved
Priority: 0/
Queue: HTML-Template-Compiled

People
Owner: Nobody in particular
Requestors: STEFFENW [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 0.93
Fixed in: (no value)



Subject: How to read the default_esape in a new plugin? How to use the escape plugins in a new plugin?
There is no method to get the default_escape written in constructor. The escapes for my new plugin I get from template. But I need the default escape too to find out, how to escape. The next thing is: How can I use the given plugins for escaping in my new plugin? I wrote all this plugins in the constructor.
On Sa. 30. Mai 2009, 07:07:46, STEFFENW wrote: Show quoted text
> There is no method to get the default_escape written in constructor. > The escapes for my new plugin I get from template. But I need the > default escape too to find out, how to escape. > > The next thing is: > How can I use the given plugins for escaping in my new plugin? I
wrote Show quoted text
> all this plugins in the constructor.
Hi, I don't understand your questions. Why is the default escape needed in a different escaping method? And how to you want to use the "gen pluins" in your plugin? regards, tina
I am writing an internationalization Plugin. It runs perfectly but I need an initialisation method to give the same default_escape like HTML::Template::Compiled->new(). I know wich escape methods are stored at HTML::Template::Compiled::Util. HTC offers a plugin concept but does not use this itself. So I have to use HTML::Template::Compiled::Util to escape. All the others escapes must give at my initialization method like HTML::Template::Compiled->new(). use HTML::Template::Compiled; use HTML::Template::Compiled::Plugin::I18N; HTML::Template::Compiled::Plugin::I18N->init( # all parameters are optional escape_plugins => [ qw( HTML::Template::Compiled::Plugins::ExampleEscape ) ], default_escape => 'HTML', translator_class => 'MyProjectTranslator', ); my $htc = HTML::Template::Compiled->new( tagstyle => [qw(-classic -comment +asp)], plugin => [ qw( HTML::Template::Compiled::Plugin::I18N HTML::Template::Compiled::Plugin::ExampleEscape ) ], default_escape => 'HTML', scalarref => \'<%TEXT VALUE="Hello World!" %>', ); Look here, some Examples to use the plugin: # output depends on default_escape <%TEXT VALUE="some static text"%> # but not here <%TEXT VALUE="some static text" ESCAPE=HTML%> allows Locale::Maketext placeholders and switch off/change escaping <%TEXT VALUE="Hello [_1]!" _1="world"%> <%TEXT VALUE="Hello [_1]!" _1="world" _1_ESCAPE=0%> <%TEXT VALUE="Hello [_1]!" _1="world" ESCAPE=HTML%> <%TEXT VALUE="Hello [_1]!" _1="world" _1_ESCAPE=0 ESCAPE=HTML%> allows Locale::TextDomain placeholders and switch off/change escaping <%TEXT VALUE="Hello {name}!" _name="world"%> <%TEXT VALUE="Hello {name}!" _name="world" _name_ESCAPE=0%> <%TEXT VALUE="Hello {name}!" _name="world" ESCAPE=HTML%> <%TEXT VALUE="Hello {name}!" _name="world" _name_ESCAPE=0 ESCAPE=HTML%> More see at the POD part of http://htc-plugin- i18n.svn.sourceforge.net/viewvc/htc-plugin- i18n/trunk/lib/HTML/Template/Compiled/Plugin/I18N.pm
I still don't understand where you have to access the default_escape and why it is not possible. Wherever you have an HTC object, you can call $htc->get_default_escape. If this isn't what you want then please make up a short example. Your example plugin is really big and I don't want to read through all of it just to understand this. You have reported several bugs and wishes, and most of the time I had problems to understand them. Contact me on irc.perl.org so we can talk in german. I'm always logged in so you can lesve me a /msg
Thank you for "$htc->get_default_escape". This is what I looked for.