Re: [htmltmpl] retrieving default values

2011-11-17 Thread Mathew Robertson
Hi Marcel, I think you have misunderstand what H::T is used for -> you put data into the template, not pull data out. In this case, DEFAULT is used when you put in VAR1, and it happens to be undef. cheers, Mathew Robertson On 18 November 2011 03:59, Marcel van Dorp wrote: > Hi list, &

Re: [htmltmpl] new work on HTML::Template

2011-04-12 Thread Mathew Robertson
Hi H::T users, Last week there was a discussion regarding enhancements to H::T. As a result, I have uploaded my enhancements to CPAN: https://pause.perl.org/pub/PAUSE/authors/id/M/MA/MATHEW/ feel free to criticise... :) regards, Mathew Robertson

Re: [htmltmpl] new work on HTML::Template

2011-04-11 Thread Mathew Robertson
ive templates" I listed above. Regards, Mathew Robertson -- Forrester Wave Report - Recovery time is now measured in hours and minutes not days. Key insights are discussed in the 2010 Forrester Wave Report as part of

Re: [htmltmpl] new work on HTML::Template

2011-04-07 Thread Mathew Robertson
f the gnus catgets() call, but from within templates (or just use a real translation engine either via preprocessing or real-time ). Thoughts? cheers, Mathew Robertson -- Xperia(TM) PLAY It's a major breakthrough

Re: [htmltmpl] Suggested Addition

2010-07-04 Thread Mathew Robertson
If you have a look at the H::T forum history, you can find many examples of this request, see here: http://www.mail-archive.com/html-template-users@lists.sourceforge.net/info.html On 3 July 2010 01:52, Alan Laas wrote: > One thing that would be nice to have is a tag. I know you > can accomplis

Re: [htmltmpl] Setting options after new()

2010-04-22 Thread Mathew Robertson
...if it doesn't work and its not documented, then dont do that. Or just create a H::T when you actually want to use it... loop_context_vars is pretty cheap so just use them, global_vars can be expensive if you have lots of loops and sub-loops and sub-sub-loops, etc. with big pages. See here:

Re: [htmltmpl] Nested templates

2009-11-24 Thread Mathew Robertson
that seems somewhat complicated - you could use a regex in the while loop, as in: while ($text =~ /http://p.sf.net/sfu/bobj-july ___ Html-template-users mailing list Html-template-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinf

Re: [htmltmpl] FW: Error using html::template

2009-06-09 Thread Mathew Robertson
request to a http-daemon, which itself serves the file. cheers, Mathew Robertson -- Crystal Reports - New Free Runtime and 30 Day Trial Check out the new simplified licensing option that enables unlimited royalty-free distributi

Re: [htmltmpl] FW: Error using html::template

2009-06-08 Thread Mathew Robertson
ile, which (presumably) is calling the underlying system call "fopen()". One possible solution might be to use the LD_PRELOAD environmental variable, to intercept fopen(), then redirect it to wget... (good luck with that... :) Other than that, I'd suggest you ask your sys-admin to f

Re: [htmltmpl] Load & Display 1 Row From DBI - Best Practice?

2009-03-17 Thread Mathew Robertson
> I'm using HTML::Template from CGI::Application. My template is getting > data via a SQL query where exactly one row > retrieved, and it is displayed using . > > What is the proper way set & display values returned from DBI when only > one row is printed? I think the method described below may

Re: [htmltmpl] Getting data from template?

2009-01-29 Thread Mathew Robertson
I did some performance profiling of H::T some time ago -> it turns out that there is quite a bit of speed up (somewhere between 10% and 10x, depending on the page) by re-writing part of the code located around line 2660. Does this pass all the .t tests? If it does then shouldn't this ge

Re: [htmltmpl] Getting data from template?

2009-01-29 Thread Mathew Robertson
Is there a version that works with HTML::Template::Pro? I'm using a template system that loads HTML::Template::Pro if available (for the speed enhancements) Really? Did you do benchmarks and find that your templating was bottleneck? And if so, how much of a gain did you get from HTML::T

Re: [htmltmpl] htree - building static HTML pages from templates

2008-07-21 Thread Mathew Robertson
the directory, it generates a file "htree-help.html" cheers, Mathew Robertson Jason A. Crome wrote: Hello, Been hacking on a little utility for a project I'm working on. htree takes a bunch of page fragments and embeds them in the HTML::Template of your choice, allowing y

Re: [htmltmpl] TMPL_INCLUDE doubt

2008-07-13 Thread Mathew Robertson
you are trying to solve actually has a better solution that doesn't depend on using a variable as the filename - using one of the various modified versions HTML::Template (aka modified by various users of this email list) which has explicit support for this syntax. hope this helps, M

Re: [htmltmpl] 2.9 loops broken?

2008-04-17 Thread Mathew Robertson
Hi Alex, I dont think anyone has responded yet... turning off die_on_bad_params is a common thing - some say it should be the default behaviour.** You dont really need it. cheers, Mathew Robertson ** ie: the GUI developer may choose to not use some params -> the output shouldn&#x

Re: [htmltmpl] HTML::Template escaping squashes HTML entities

2008-03-24 Thread Mathew Robertson
ree. Unfortunately I've inherited a lot of the code and it needs to support all charsets. :( On Thu, 20 Mar 2008 14:31:54 +1100, Mathew Robertson wrote Have you tried using utf8 as the encoding? You will get far more millage out of utf8 than using entities. regards, Mathew Alex Tesl

Re: [htmltmpl] HTML::Template escaping squashes HTML entities

2008-03-19 Thread Mathew Robertson
Have you tried using utf8 as the encoding? You will get far more millage out of utf8 than using entities. regards, Mathew Alex Teslik wrote: Hello, I'm developing an app where there are some strings that have HTML entities in them, such as: This is a "Tést" These strings need to go into

Re: [htmltmpl] HTML::Template with simplified/automated fill in from database.

2008-02-24 Thread Mathew Robertson
Hi Ronald, I am looking to generate easy visualizations of objects serialized in a database USING the underlying model. It sounds like you're talking about a glue between "model" components like dbix::class, class::dbi, etc? Close. Yes a glue layer between HTML::Template and a databa

Re: [htmltmpl] hash of hashes

2008-01-08 Thread Mathew Robertson
Without further information on what you are trying to do and why you are making the hash like so - I'm not sure what you are asking. ie: what are you trying to loop through, a list of IP addresses? the arp cache? assuming the IP address: my $ht = HTML::Template->new("some.tmpl"); my @loop;

[htmltmpl] die_on_missing_params

2007-10-31 Thread Mathew Robertson
e email me updated module. cheers, Mathew Robertson - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser

Re: [htmltmpl] Other modules...

2007-10-29 Thread Mathew Robertson
I use a modified version of H::T that allows the TMPL_xxx syntax to grow and which has support for dynamic loading of the escaping modules. I also tend to use some specific filters. So "no, not H::T::A" or other modules, and "yes, some locally modified stuff". regards, Mathew Robert Hicks wrot

Re: [htmltmpl] Filter Syntax

2007-08-09 Thread Mathew Robertson
with filters, that it simply wont do -> I might be able to suggest an alternative solution if I know what the problem was. cheers, Mathew Robertson Chris Faust wrote: Folks, I'm having (what I hope is) a syntax problem. I'm trying to use the "filter" option

Re: [htmltmpl] apache and html template

2007-07-12 Thread Mathew Robertson
loaded from a file, a database, hand-coded inside the source file, etc. - Is your HTML header setting the appropriate UTF8 strings so that the browser is displaying the content correctly? regards, Mathew Robertson Blesson Paul wrote: > Hi, > > I have an issue with Polish character

Re: [htmltmpl] Bug in param() when odd reference passed in?

2007-07-09 Thread Mathew Robertson
re-esque" template variables, eg: name.fist, name.last. If your version of H::T supports this, then one could argue that passing in a hash (or hash ref), should auto-vivify the template variables. For example: $ht->param( name => { first => "fred", last => "f

Re: [htmltmpl] Odd slowdown in HTML::Template with INCL and LOOP

2007-07-09 Thread Mathew Robertson
Past programming experience tells me that "for { for { ... }}" is O(n^2)... so that is always the first thing I look for. H::T has this case at the very start of the output() code block -> so its a good candidate for profiling. > >> regards, >> Mathew Robertson >> >

Re: [htmltmpl] Odd slowdown in HTML::Template with INCL and LOOP

2007-07-04 Thread Mathew Robertson
various points within "output()". I have done this previously and found that I was able to find a dramatic increase in performance, just by removing foreach() loops. ** regards, Mathew Robertson ** If you interested, I can send you a patch which ("works for me") speed's up the

Re: [htmltmpl] problem: Not an ARRAY reference in Expr.pm

2007-06-25 Thread Mathew Robertson
Hi Marcin, This has been sitting in my inbox for a while, but I didn't really have an ideas. Have you tried enabling the file_cache only (ie not the memory cache)? It may help nail whether the problem is with H::T or something else. regards, Mathew Robertson Marcin Gryszkalis wrote:

Re: [htmltmpl] apache and html template

2007-06-17 Thread Mathew Robertson
Hi Paul, Which version of Perl are you using? I have used 5.6.x and 5.8.x and found that 5.8.3 or better was required for bug-less operation. Mathew Robertson Blesson Paul wrote: > My problem is same as this one > http://www.template-toolkit.org/pipermail/templates/2003-March/00431

Re: [htmltmpl] die_on_missing_params

2007-06-14 Thread Mathew Robertson
--)?>.*?<(?:\!--\s*)?\/[Tt][Mm][Pp][Ll]_[Cc][Oo][Mm][Mm][Ee][Nn][Tt]\s*(?:--)?>/s; $$text_ref =~ s/$match//g; }; return $filter; } $ht = HTML::Template->new(, filter => tmpl_comment,...); ... some html Regards, Mathew Robertson --

Re: [htmltmpl] die_on_missing_params

2007-05-31 Thread Mathew Robertson
lds. > > Where can I find your patch? > > Thanks again, > Josh "Ua" Ball > > On 5/31/07, Mathew Robertson <[EMAIL PROTECTED]> wrote: > >> Short answer: no there isn't such a feature. >> >> However I do have a patch I use to ad

Re: [htmltmpl] die_on_missing_params

2007-05-31 Thread Mathew Robertson
your code would need the above line added where appropriate. I found that I would often write: $ht->param(param_name => get_something()); so param_name would be explicitely set to undef, and so the patch works for me. Mathew Robertson Joshua wrote: > Greetings. > > (I'm so

Re: [htmltmpl] loop counting

2007-05-03 Thread Mathew Robertson
the break tag > on the first set of nested template loop date? > > For example: > > > > > ... > > > > > > > Can I "see" the counter for the parent loop inside the child loop? > > Thanks. > > greanie > > - Orig

Re: [htmltmpl] problem: Not an ARRAY reference in Expr.pm

2007-05-02 Thread Mathew Robertson
Hi Marcin, Are you using a filter by any chance? If so, you could try temporarily disabling it and/or could you post a code snippet if its use. Mathew Marcin Gryszkalis wrote: > One in every few calls to my application ends with error desctribed below. > I'm not sure when it started or what s

Re: [htmltmpl] loop counting

2007-04-30 Thread Mathew Robertson
sure thing - but it does require using H::T::Expr. I use the following snippet as-is to a gallery of photo's. Notice the use of modulo (%). Mathew

Re: [htmltmpl] Numeric loops

2007-04-29 Thread Mathew Robertson
>> If you just want to print 4 stars, then just do that. * * * * >> >> If you are looking for some indentation background, you could try >> something like the following on a div: >> >> style="background:url('star.gif') right repeat-y;" >> >> If you are looking for something like then you >>

Re: [htmltmpl] Numeric loops

2007-04-29 Thread Mathew Robertson
> > Is there a way to loop from a lower integer to an higher one? For > example, > say an article has a rating of 4. I'd like to loop from 1 to 4 and > print a > star at each iteration. The only way I can see of doing this is > create an > array ref in the perl coder an

Re: [htmltmpl] Feature Idea [TMPL_VIRTUAL]

2007-04-03 Thread Mathew Robertson
utput of > helloworld.tmpl. > > Hmm - I think I may have just realized what you were talking about, > but this whole feature wouldn't be useful for including nested > templates, but rather the output from a URL (i.e. a cgi script, php > page, etc) > > Sorry for the ramb

Re: [htmltmpl] Feature Idea [TMPL_VIRTUAL]

2007-04-02 Thread Mathew Robertson
Hi Jason, I personally think this is a good idea, especially if it was provided by a plugin (which means other TMPL_xxx's would also be possible). In this case probably what you want is to use a TMPL_VAR which contains the output of a seperate H::T instance, as in: my $ht = new H::T(filename =>

Re: [htmltmpl] escape html whitespace

2007-04-01 Thread Mathew Robertson
>> I couldn't find this information in the archive... >> >> I like the ESCAPE options (HTML, URL, JS). >> >> Is there a way to also escape whitespace? In particular, I would like >> an easier way to replace spaces with   >> >> Currently looping through data from dbi and replacing. Any ideas? >>

Re: [htmltmpl] How to handle UTF-8?

2007-03-25 Thread Mathew Robertson
>> As an aside, there are a number of different techniques used to get >> the UTF8 strings into the templates, eg: TMPL_VAR's, hacks to H::T, >> using H::T::E with a callback. > > Why would you need a hack to get UTF8 strings into the templates? Is > there a bug I should be fixing here? ahh - my

Re: [htmltmpl] How to handle UTF-8?

2007-03-20 Thread Mathew Robertson
I worked on a product which was translated into 6 languages; we supplied templates in ASCII and used TMPL_VAR's to output the appropriate UTF8-encoded string. ie: there are no real problems if your templates are just layouts and the content is provided by TMPL_VAR's. As an aside, there are a

Re: [htmltmpl] Comments

2007-03-07 Thread Mathew Robertson
Yep, that is the form - although you wont need to 'capture', eg: $$text_ref =~ s|.*?||gx; Mathew > sub tmpl_remark { > my $text_ref = shift; > > $$text_ref =~ s|(\w+)||gx; > } > > > # passed to the template > > filter => \&tmpl_remark; > > I did not know you could use a regex in a subst

Re: [htmltmpl] Comments

2007-03-07 Thread Mathew Robertson
There is a performance hit, but only at template-parse time. ie: if you use caching there is no performance hit. Mathew Dan Horne wrote: One way is to use H::T filters. You could have something like and in your code, and use the filter functionality to remove the tags and enclosed content.

Re: [htmltmpl] Next H::T release.

2006-12-04 Thread Mathew Robertson
>> One could argue that a template variable of "user_some_funky_permission" >> should be created by the application. But then why should the >> application programmer create the cross-product of every template >> variable; it is up to the template designer to decide when the >> some_funky_menu

Re: [htmltmpl] Next H::T release.

2006-12-03 Thread Mathew Robertson
>> Bugs: >> >> >> - Use "UNIVERSIAL::isa(...)" and "SUPER" in the appropriate places >> so that sub-classes work correctly. >> > > Why should H::T use SUPER? > If H::T::E calls H::T->do_something, then when a subclass overrides that do_something method, the subclass method isn't calle

Re: [htmltmpl] Next H::T release.

2006-11-22 Thread Mathew Robertson
ith TMPL_ELSIF. - Allow recursive H::T invocations for those cases where people _realy_ want to do >... [ and thus deal with the consequences of such an act... :-) ] cheers, Mathew Sam Tregar wrote: > > On Fri, 17 Nov 2006, Mathew Robertson wrote: > >> sure thing - see attached. >&g

Re: [htmltmpl] Next H::T release.

2006-11-16 Thread Mathew Robertson
sure thing - see attached. I have a few other ideas about enhancements which you may or may not be interested in - should I furnish a list of ideas? Mathew Sam Tregar wrote: > On Fri, 17 Nov 2006, Mathew Robertson wrote: > >> Since you mentioned that you are hoping to do a relea

[htmltmpl] Next H::T release.

2006-11-16 Thread Mathew Robertson
Hi Sam, Since you mentioned that you are hoping to do a release sooner or later, could you consider the following two changes: - bug file for included line numbers Change this code (starting on line: 2318): # count newlines in chunk and advance line count $fcounter += scalar(@{[$chunk =

Re: [htmltmpl] Suggestion on how to eliminate Cross-site-scripting (XSS) bugs for good.

2006-10-25 Thread Mathew Robertson
>> Having read the thread, I don't think that's enough for me. I want to still >> need to explicitly specify "ESCAPE=HTML" everywhere (without having a default >> escape), to have an exception raised on a non-escaped occurence, and to add >> an explicit unescaping (like "ESCAPE="0""). > > Let me s

Re: [htmltmpl] Multi Language

2006-08-22 Thread Mathew Robertson
Hi there, There are a number of ways to implement multi-language support, depending on your personal preference. Dynamic content sometimes shouldn't be translated, other times it should be translated. eg: if you have the car company "Nissan", in most languages you dont translate, but in Japanes

Re: [htmltmpl] Speeding up H::T

2006-06-26 Thread Mathew Robertson
Hi Matthew, Are you using 'global_vars', then H::T can be made to have a very large speed up by replacing the code from lines 2624-2650 with: if (scalar(@{$options->{associate}})) { my @undef_params; foreach my $param (keys %{$self->{param_map}}) { next if (defined $self->param($p

Re: [htmltmpl] Small questions.

2006-05-17 Thread Mathew Robertson
You can use a filter to strip stuff from your templates - check the list archive for examples Mathew 2) Wouldn't be nice to have a template comment tag? I think it would be useful to describe template, and not generate HTML. For example: or In our project we 'compile' the templates befo

Re: [htmltmpl] Small questions.

2006-05-17 Thread Mathew Robertson
Shared cache has the nice effect of reducing the memory footprint of the templates, when running apache in multi-process mode. Mathew Yeesh - shared_cache is terrible. I really should remove it. It's no faster than file_cache and much more prone to problems. Both are much slower than regula

Re: [htmltmpl] Template Error Managment

2006-04-27 Thread Mathew Robertson
In our application we use an "errors" TMPL_LOOP variable -> the application code populates this variable with any errors, as in: push @errors, { message => translate("Some error text") }; then the templates: where errors.tmpl contains ... ... ... ... Hope this helps, Mathew Ja

Re: [htmltmpl] ESCAPE=XML

2006-04-26 Thread Mathew Robertson
Hi Sam, The highly modified version of H::T that I use, does contain an extensible ESCAPE plugin mechanism - main features: - users can plugin their own ESCAPEs by deriving from H::T::ESCAPE - ESCAPE modules are loaded at parse-time - extra escaping modules: DOUBLE_QUOTE - which simply puts do

Re: [htmltmpl] loop through a hash structure without knowing the hash keys?

2005-12-07 Thread Mathew Robertson
As a thought, you could try something like this: print Dumper($ht->{param_map}); I haven't tested it, but it may work... Mathew Boon Chew wrote: Thanks Carl, useful tip. Taking your idea one step further, I think having an option such as show_all_params => 1 that shows all the params pa

Re: [htmltmpl] Alternate loops

2005-12-02 Thread Mathew Robertson
Hi Jonathan, I think the exampe of: @loop = ( ... {value_set => 2, count_distribution => 1, sum_of_counts => 36 }, ... ) is invalid, since you never generate the loop contruct like that. Usually you would do something like: for ($min..$max) {# - loop through to

Re: [htmltmpl] loop through a hash structure without knowing the hash keys?

2005-12-02 Thread Mathew Robertson
Replied unzipped-content, off-list Jonathan Lang wrote: PS. I maintain a version of H::T which supports sub-classing so that you can create your own TMPL tags, see: http://members.optusnet.com.au/~mathew Nice, except that I can't extract it from the computer that I'm at (gr

Re: [htmltmpl] loop through a hash structure without knowing the hash keys?

2005-12-01 Thread Mathew Robertson
agree with you that the coupling cannot be totally avoided, but being able to deal with template var generically in the presentation layer is very useful in avoiding having to create duplicate html code that are doing exactly the same thing.  - boon Mathew Robertson <[EMAIL PROTECTED]>

Re: [htmltmpl] Re: HTML::Template bug report: Problems using cache

2005-12-01 Thread Mathew Robertson
Since there wasn't any new release for more than one year I would also like to ask you whether this package is still maintanted. It's still maintained, although I'm too busy to spend a lot of time on it right now. Maybe next year... But it would still

Re: [htmltmpl] loop through a hash structure without knowing the hash keys?

2005-12-01 Thread Mathew Robertson
ate module (vs Mason where you mingle Perl code with display code) right?  It just seems ugly when I have to tell a designer to go look at the perl file to see what he is getting in the var.  He should be able to find that out from some sensible constructs. - boon Mathew Robertson <[EMAIL

Re: [htmltmpl] looping through a subset of data?

2005-12-01 Thread Mathew Robertson
This is easiest achieved if you use H::T::Expr, eg:        ...     Mathew Boon Chew wrote:  Another newbie question about HTML::Template. Is there a way to output only a subset of a loop variable? For instance, let's say I have a template var that is a reference to array of ha

Re: [htmltmpl] loop through a hash structure without knowing the hash keys?

2005-12-01 Thread Mathew Robertson
It sounds like you need a tool which simply dumps the template variable names (ie: using the $ht->params() function), rather than some special mode to H::T Mathew Boon Chew wrote: Ya sorry, that's what I meant. Right now I am working on some site code, and the designer sometimes have to

Re: [htmltmpl] Writing an extension for HTML::Template - how to do it?

2005-11-08 Thread Mathew Robertson
Anyway - I already looked into that. It's what CGI::Application::Framework uses. But it's not what I need/want. That way I can only call some run_mode (method) from current module (one that is outputing the template in the first place). I would need to manualy add plugins to each of

Re: [htmltmpl] HTML::Template and XHTML

2005-10-25 Thread Mathew Robertson
you can do this with a filter: my $match = qr/(<[Tt][Mm][Pp][Ll]_[^>]+)\/>/; my $filter = sub { my $text_ref = shift; $$text_ref =~ s/$match/$1>/g; }; $match is the regex used to find tags. Then instantiate H::T with the 'filter' option. Hope this helps, Mathew Chris Beck wrote: Hey all,

Re: [htmltmpl] option to turn ESCAPE=HTML on by default

2005-10-25 Thread Mathew Robertson
tracted enough inside HTML::Template. * Mathew Robertson <[EMAIL PROTECTED]> [October 20 2005, 08:22]: Is layered-escaping that is needed, or can we simply make a new escape module called, say "HTML_JS" Mathew Alex Kapranoff wrote: * Philip Tellis <[E

Re: [htmltmpl] Wrapper functionality

2005-10-20 Thread Mathew Robertson
There are a number of reasons why this is a bad thing, among them: - performance -> you cant make user of cached templates - error messages can be extremenly cryptic. That said, I maintain a modified version of H::T which does include this feature - you can download it from here: http://membe

Re: [htmltmpl] option to turn ESCAPE=HTML on by default

2005-10-19 Thread Mathew Robertson
Is layered-escaping that is needed, or can we simply make a new escape module called, say "HTML_JS" Mathew Alex Kapranoff wrote: * Philip Tellis <[EMAIL PROTECTED]> [October 18 2005, 16:02]: s/pretty hard/impossible/; That's why there's only 1 _default_. Oh

Re: [htmltmpl] option to turn ESCAPE=HTML on by default

2005-10-16 Thread Mathew Robertson
If this is going to happen, can we make it optional, as some of us dont want escaping. Mathew I'm curious about what other people think about an option to turn ESCAPE=HTML on default, to protect against cross script scripting practices by default. Sure, sounds reasonable to me. --

Re: [htmltmpl] HTML::Template for WML

2005-06-28 Thread Mathew Robertson
> HTML::Template works for anything as you all know. The trouble I'm > having is that WML needs more escaping than good old HTML (WML turned > out to be a templating language in itself with user agent performing > simple variable substituition in the document). > > As far as I understand the only

Re: [htmltmpl] Encode parameters (feature request?)

2005-06-23 Thread Mathew Robertson
You could sub-class H::T then overload param() to do whatever you needed to do. Would this help? Mathew - Original Message - From: "Dan Horne" <[EMAIL PROTECTED]> To: "'Mathew Robertson'" <[EMAIL PROTECTED]> Sent: Friday, June 24, 2005 9:07 AM

[htmltmpl] Locale::Maketext vs Locale::MakePhrase [was: HTML::Template and Locale::Maketext]

2005-05-27 Thread Mathew Robertson
> For example you could use {{ ... }} to hide . > This could yield to: > > {{We have [quant,_1,visitor] today,, visitor_count}}> The syntax of: We have [quant,_1,visitor] today was one of the my dislikes of Locale::Maketext. Locale::Maketext assumes that the programmer knows: a) the

Re: [htmltmpl] HTML::Template and Locale::Maketext

2005-05-26 Thread Mathew Robertson
> The only real issue that the programmer has to do is to set a few extra > template variables: > > TMPL_VAR document_charset > TMPL_VAR document_direction > TMPL_VAR document_language > TMPL_VAR document_direction_default > TMPL_VAR document_direction_inverse > > The first three should

Re: [htmltmpl] HTML::Template and Locale::Maketext

2005-05-26 Thread Mathew Robertson
Translation issues aside, one of the best parts of storing translations in a database is that you can quite easily build a web interface to the database table. You write a script which greps your source-code/templates so that it inserts the new strings, and deletes any unused ones. This works

Re: [htmltmpl] HTML::Template and Locale::Maketext

2005-05-26 Thread Mathew Robertson
Hi Johan, About 18 months ago I had a similar requirement, and thus eventually got around to looking at Locale::Maketext. One of the key points that the documentation makes, is that English is not a language that you should derive your second language from. One problem I had with L::M was tha

Re: [htmltmpl] problem in patching..

2005-04-28 Thread Mathew Robertson
Hi Amit, I have just cut-n-pasted your code -> it works perfectly. Without further information, I'm not sure we can help... regards, Mathew - Original Message - From: "Amit Marathe" <[EMAIL PROTECTED]> To: Sent: Thursday, April 28, 2005 8:17 PM Subject: [htmltmpl] problem in patching..

Re: [htmltmpl] Sub-Classing HTML::Template v2.7

2005-03-06 Thread Mathew Robertson
There are some places in H::T where this is done... and I agree with you -> its wrong if you need to subclass H::T... However, you should be able to simply change it to: $self->_new_from_loop(...) Perl will automatically dereference $self so as to determine the correct package name - in fact r

Re: [htmltmpl] RFC: Persistent or 2-stage evaluation

2005-01-18 Thread Mathew Robertson
> The three things I've found that make multi-language processing difficult > with H::T are: > > 1. One-time evaluation of a template's page-specific vars (so that > subsequent displays can deal only in truly variable evaluations). > 2. No way to say to > use language-specific text determined at

Re: [htmltmpl] RFC: Conditional TMPL_INCLUDE

2005-01-10 Thread Mathew Robertson
> > although I wouldn't consider some of the enhancements "feature > > creep" (ie I think not having TMPL_ELSIF would mean that a feature > > is missing) -> I thank him for producing a very use piece of code. > > Thanks, I appreciate that. I'm certainly not above changing my mind > if enough peop

Re: [htmltmpl] RFC: Conditional TMPL_INCLUDE

2005-01-10 Thread Mathew Robertson
I respect Sam's opinion on what should and shouldn't go into H::T, although I wouldn't consider some of the enhancements "feature creep" (ie I think not having TMPL_ELSIF would mean that a feature is missing) -> I thank him for producing a very use piece of code. And these enhancements show t

Re: [htmltmpl] RFC: Conditional TMPL_INCLUDE

2005-01-04 Thread Mathew Robertson
r I found it to be limiting in some specific ways, thus I created Locale::MakePhrase which I believe to be much more powerful. - Original Message - From: "Mark Fuller" <[EMAIL PROTECTED]> To: "Mathew Robertson" <[EMAIL PROTECTED]>; Sent: Wednesday, Ja

Re: [htmltmpl] RFC: Conditional TMPL_INCLUDE

2005-01-04 Thread Mathew Robertson
> I just had a need to conditionally include one of a few templates dependnig > on the value of a TMPL_VAR. One of the includes (which would not have been > loaded) did not exist, but H::T died because it couldn't locate that file. I > realized H::T probably loads everything at compile time and app

Re: [htmltmpl] Templates with template loops within templates

2004-12-16 Thread Mathew Robertson
Hi Eric, It sounds like you have hit the dreaded "top level param, not referenced before use in template loop, so I'll just do nothing" bug... try this somewhere before your first TMPL_LOOP (say at the top of the file), in your first template: which _should_ do absolutely nothing useful/h

Re: [htmltmpl] Re: Html-template-users digest, Vol 1 #468 - 3 msgs

2004-11-28 Thread Mathew Robertson
> > Are you perhaps unfortunate enough to be using RedHat 8 or 9 and > > Perl 5.8.0, which broke the localisation support quite badly? If > > so, consider a Perl version upgrade. > > The perl version is 5.005_03, I am not sure about the linux distrubution. I > am on a shared > hosting environmen

Re: [htmltmpl] RE: Patch to encode iso-8859-1 using HTML::Entities

2004-11-07 Thread Mathew Robertson
> > I'd suggest that you dont do this... Adding support for > > ISO-8859-1 directly into H::T will set a precedent for other > > encodings (not everyone uses the Latin character set)... > > Unfortunately, the precedent is that H::T generates broken, > non-compliant HTML. The spec says that anyt

Re: [htmltmpl] RE: Patch to encode iso-8859-1 using HTML::Entities

2004-11-07 Thread Mathew Robertson
I'd suggest that you dont do this... Adding support for ISO-8859-1 directly into H::T will set a precedent for other encodings (not everyone uses the Latin character set)... Why not just output the text as UTF8? Mathew - Original Message - From: "Dave W. Smith" <[EMAIL PROTECTED]> To

Re: [htmltmpl] get value from template?

2004-11-03 Thread Mathew Robertson
> I'm looking for suggestions on how to get a value from my template that can > be used in my Perl code. I'd rather not switch to another template module > that would provide this since HTML::Template has otherwise met my needs. > > The details... > > In my template, I'd like to have something

Re: [htmltmpl] FORMAT= enhancement to construct

2004-10-06 Thread Mathew Robertson
yes - but the question was whether this type of functionality was suitable to be added as a native capability. Mathew > All those and more can be done using HTML::Template::Expr. > > > > I'd generally agree (mostly) -> the formatting of data is up to the GUI designer, > > eg if I want the num

Re: [htmltmpl] MARK= enhancement to the HTML::Template LOOP construct

2004-10-06 Thread Mathew Robertson
t of the time is spent generating the page data, not generating the page output.   Mathew   - Original Message ----- From: Bob Diss To: Mathew Robertson Sent: Thursday, October 07, 2004 11:36 AM Subject: Re: [htmltmpl] MARK= enhancement to the HTML::Template LOOP const

Re: [htmltmpl] Allow coderef's for LOOP variables

2004-10-06 Thread Mathew Robertson
I see...  in that case, I guess it would be a suitable thing to do...     regards, Mathew   - Original Message - From: Bob Diss To: Mathew Robertson Sent: Thursday, October 07, 2004 11:18 AM Subject: Re: [htmltmpl] Allow coderef's for LOOP variables

Re: [htmltmpl] HTML::Template::Compile - anonymous sub and eval H::T

2004-10-06 Thread Mathew Robertson
what a good idea... could you make the code available?   Mathew - Original Message - From: Bob Diss To: [EMAIL PROTECTED] Sent: Thursday, October 07, 2004 7:06 AM Subject: [htmltmpl] HTML::Template::Compile - anonymous sub and eval H::T An item I ran into

Re: [htmltmpl] Allow coderef's for LOOP variables

2004-10-06 Thread Mathew Robertson
hmm... not sure about that...   If your TMPL_IF takes one branch which doesn't result in generating output, why didn't the Perl code test the same value and not generate the unused H::T param data?   Mathew - Original Message - From: Bob Diss To: [EMAIL PROTECTED] Sen

Re: [htmltmpl] FORMAT= enhancement to construct

2004-10-06 Thread Mathew Robertson
I'd generally agree (mostly) -> the formatting of data is up to the GUI designer, eg if I want the number 100 to contain comma's, I shouldn't need to get the Perl programmer to generate the a stringified value caontaining them.   Although, there would need to be alimit on this functional

Re: [htmltmpl] MARK= enhancement to the HTML::Template LOOP construct

2004-10-06 Thread Mathew Robertson
My local copy of H::T is modified so that a) you can create custom TMPL_xxx tags, and b) you can create custom ESCAPE tags by overloading a H::T::Escape (I have factured out that functionality into seperate modules).   I'd be interested to how you did this MARK stuff - I have previously used

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

2004-09-30 Thread Mathew Robertson
Since filters are applied to each file as it is loaded, TMPL_SET's in the parent file, are not in scope of the included file...thus it looks like this isn't going to solve your problem. Mathew - Original Message - From: "Thilo Planz" <[EMAIL PROTECTED]> To:

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

2004-09-30 Thread Mathew Robertson
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. Hope this helps, Mathew - Original Message - From: "Thilo Planz" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, October

Re: [htmltmpl] Re: eWeek Reviews Bricolage

2004-08-11 Thread Mathew Robertson
> > you are kidding right? > > Not at all. That doesn't mean I expect to convince anyone though. > This is the kind of wisdom that usually only comes from experience! I'll ignore that... > > ACID capabilites and all that... > > proper locking semantics... > > long history with native support fo

Re: [htmltmpl] Re: eWeek Reviews Bricolage

2004-08-11 Thread Mathew Robertson
you are kidding right? ACID capabilites and all that... proper locking semantics... long history with native support for transactions... proper SQL transaction semantics... As you said, people can make spaghetti out of anything - how this makes MySQL 'better', I dont understand. Mathew > > >

Re: [htmltmpl] Is HTML::Template pure Perl?

2004-08-01 Thread Mathew Robertson
Title: Message yes - so long as your PERL5LIB value is set before you start your instance of the web server.   Note that you may not be able to use the "shared memory" caching option under win32 -> although the file-caching mechanism should work ok.   Mathew     - Original Message

Re: [htmltmpl] Is their a maximum amount of data that can be disp layed by HTML:: Template?

2004-07-13 Thread Mathew Robertson
> > That looks like a generic IE error message - look at the bottom of > > the page. It probably has something like - > > > > HTTP 500 - Internal server error > > Internet Explorer > > > > My guess is you're timing out before the results can be served up. > > Grrr. You are absolutely right. I

  1   2   >