[htmltmpl] H::Template and CGI::Application

2004-10-14 Thread Thilo Planz
Hi, I've been using HTML::Template for a while, but am having a weird problem when using it in a CGI::Application app. Basically, when I call $template->output, the application requests the page from the server twice, instead of once if I just create and return my own HMTL. Not sure what is happ

Re: [htmltmpl] setting template parameters from within the template?

2004-09-30 Thread Thilo Planz
Attached is H::T::Filters module which implements some common filters. One of them is the TMPL_SET filter which can be used to do what you are asking for. Thanks, that is a useful module, but I cannot make it work on included files. (The included file can not see what you TMPL_SET'ed is the "ou

[htmltmpl] setting template parameters from within the template?

2004-09-30 Thread Thilo Planz
Hello, is there a way to set template parameters from within the template? I would like to do this because I have pages that include a common header (who doesn't ?) and that header makes a page title. At the moment, I have to set "page_title" in my application code (well, not really, it is fac

Re: [htmltmpl] how to use UTF8?

2004-07-13 Thread Thilo Planz
I have a problem with using UFT8-encoded templates. The problem seems to be caused by the templates not being open'd() with the :utf8 flag. Does it work if you open() them yourself and pass the filehandle to new() instead of the filename? I suppose that would work, but I cannot do that for the inc

[htmltmpl] how to use UTF8?

2004-07-13 Thread Thilo Planz
Hi, I have a problem with using UFT8-encoded templates. The problem seems to be caused by the templates not being open'd() with the :utf8 flag. I can use these templates with HTML::Template just fine, unless I put in template parameters that are Unicode strings. As long as there are no paramete

Re: [htmltmpl] cache-ing question

2003-02-13 Thread Thilo Planz
Hi, I have a mod_perl/CGI::Application program that I've written that populates a HTML::Template with a list of files that are on the server. I'd like to cache that list, based on the URL, so that it doesn't have to do a readdir(), grep() and also a TreeBuilder to get the TITLE everytime som

[htmltmpl] Associate object / case-sensitive template performance patch

2002-11-10 Thread Thilo Planz
HTML::Template source code: # what a hack! This should really be optimized out for case_sensitive. Well, I did just that. Please find attached the patch for HTML::Template 2.6. Patch the files Template.pm and test.pl (I added two new tests). Regards, Thilo Planz test.pl.patch

Re: [htmltmpl] hierarchical template parameters patch

2002-10-03 Thread Thilo Planz
Hi Mark, Glad you like it. > Would it work for something like this: > > package Object; > > sub new { > my ($class, $id) = @_; > my $self = {}; > bless $self, $class; > $self->{name} = "name of object"; > $self->{id} = $id; > return $self; > } > > package main

[htmltmpl] hierarchical template parameters patch

2002-10-02 Thread Thilo Planz
'b' => {'c'=>3, 'd'=>4} } ); to set Anyone else think this is useful? Cheers, Thilo Planz === Here is the patch: # if the value is a hashref, # construct parameters