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

2009-06-09 Thread Mark Fuller
On Mon, Jun 8, 2009 at 6:11 PM, Mathew Robertson wrote: > Other than that, I'd suggest you ask your sys-admin to fix their > security policy What about using wget or curl to read the file, and then use the feature of H::T's "new" method to load a template from a variable? (scalarref => $ref_t

Re: [htmltmpl] TMPL_INCLUDE doubt

2008-07-14 Thread Mark Fuller
On Sun, Jul 13, 2008 at 5:37 PM, Mathew Robertson <[EMAIL PROTECTED]> wrote: > Hi Rajesh, > > I dont think anyone has answered this yet... I replied to him. But, didn't notice it was only to him (not the list). I pointed out how the filter function can be used at the time the template is loaded. A

Re: [htmltmpl] Param() with a hashref

2008-04-29 Thread Mark Fuller
On Tue, Apr 29, 2008 at 8:05 AM, James Hardy <[EMAIL PROTECTED]> wrote: > It might be an idea to include that in the docs for people like me who are > still a little clueless about the many ways of doing the same thing in Perl. You can also annotate the POD on CPAN. I've found a lot of useful info

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

2008-02-23 Thread Mark Fuller
On Sat, Feb 23, 2008 at 5:13 AM, Ronald Schmidt <[EMAIL PROTECTED]> wrote: > 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? Wha

Re: [htmltmpl] Addendum/Correction to: Template output for email scripts adding extra line breaks

2007-12-19 Thread Mark Fuller
On 12/19/07, Brad Baxter <[EMAIL PROTECTED]> wrote: > And while it's easy for me to figure this out, I have a hard time believing > that it would be easy for H::T to know exactly what I want. But what if > there were a good mechanism for communicating that. Wait, that > describes filters ... I t

Re: [htmltmpl] Addendum/Correction to: Template output for email scripts adding extra line breaks

2007-12-18 Thread Mark Fuller
On 12/16/07, Brad Baxter <[EMAIL PROTECTED]> wrote: > A template novice might complain that HTML::Template is adding extra > line breaks, but of course, they are right there in the template. I'm not a template novice and I still complain about the extra line breaks. I think it's debatable whether

Re: [htmltmpl] Re: wish:

2005-08-07 Thread Mark Fuller
From: "Mark Stosberg" <[EMAIL PROTECTED]> > > It sounds nice but I'd personally find it pretty useless. Most of my > > use of HTML::Template involves inspecting the template with query() > > and setting up the variables and loops that are actually requested. > > Interesting. I hadn't heard of that

Re: [htmltmpl] t, name var Re: Loop Quirk

2005-07-21 Thread Mark Fuller
Leander,   Are you saying that you believe H:T isn't working correctly because IE doesn't behave the same as other browsers? Or, are you really seeing H::T emit something different than you expect it to emit? That's a big difference. You may have invalid HTML causing IE to break (or its vers

Re: [htmltmpl] Nesting TMPL tags

2005-07-12 Thread Mark Fuller
From: "Rajesh_K" <[EMAIL PROTECTED]> >Is this part of the HTML::Template::expr package? I don't see any %...% construct in HTML::Template. Sorry I am asking you this... ppm is down at activestate and I cant get at the expr module! Rajesh, Philip is suggesting that you markup your template so tha

Re: [htmltmpl] Bug in die_on_bad_params handling

2005-07-07 Thread Mark Fuller
From: "Sam Tregar" <[EMAIL PROTECTED]> > The loop output code calls param() to setup each row. I see it now. The output method calls the package HTML::Template::LOOP which calls param(). It would take some work to 1) collect (in a hash) die_on_bad_param flags when the user calls param() with an ar

Re: [htmltmpl] Bug in die_on_bad_params handling

2005-07-07 Thread Mark Fuller
From: "Sam Tregar" <[EMAIL PROTECTED]> > That's a run-time error that happens during output() and the relevent file and > line numbers are currently only available during parse(). Sam, I'm curious: Why wouldn't my suggestion work? The croaked message Matija referred to is in the param method. I ca

Re: [htmltmpl] Bug in die_on_bad_params handling

2005-07-07 Thread Mark Fuller
From: "Matija Grabnar" <[EMAIL PROTECTED]> > Setting up the loops would be expensive, since it involves a LOT of data You may already know this. It would be fairly easy for you to subclass H::T to use your own modified param method. Modify it to accept a second parameter: @foo=({bar=>1,b

[htmltmpl] Persistent evaluation (solution with sample code)

2005-01-24 Thread Mark Fuller
Cees Hek provided me with a solution using H::T's filter. I think Sam suggested a filter first but, I didn't understand. (I would'nt have figured this out without seeing the sample Cees gave me.) It involves passing the language value to H::T's load_tmpl method. Then override H::T's _cache_key met

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

2005-01-18 Thread Mark Fuller
From: "Mathew Robertson" <[EMAIL PROTECTED]> > >provide a different template for each language I initially went this way. But, I didn't like duplicating page structure. I found that I *really* like to keep everything in Locale::Maketext lexicons. But, the downsides are: 1. The Locale::Maketext is

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

2005-01-18 Thread Mark Fuller
From: "Ragan, Steve" <[EMAIL PROTECTED]> > Portions that > pertain to user-specific variables are "renamed" (or purposely misnamed, if > you will) TMPL_VAR's so they are not recognized and handled by H::T during > this pass. > > > > [then] > > $output =~ s/my_special_VAR/TMPL_VAR/g; Steve, th

[htmltmpl] RFC: Persistent or 2-stage evaluation

2005-01-18 Thread Mark Fuller
Sam, earlier I said it would be useful if I could apply some evaluation once. Then operate upon that partially evaluated template. I didn't realize H::T applies everything at output(?). If H::T applies everything at output, wouldn't it be relatively easy to accomplish this if there was a way to te

Re: [htmltmpl] TMPL_IF and OR

2005-01-14 Thread Mark Fuller
From: "Thomas Gutzler" <[EMAIL PROTECTED]> > Could something like this be possible: Why not say: And then perform the conditional processing in your Perl program to set $my_foo_bar and output it to the template thusly: $template->param(FOO_BAR => $my_foo_bar); Otherwise you could do TMPL_IF a

[htmltmpl] One-time evaluation (was conditional include)

2005-01-07 Thread Mark Fuller
From: "Sam Tregar" <[EMAIL PROTECTED]> > Are you sure it needs to happen "only once"? Your example doesn't > support that meaning. In your example the language-specific stuff > needs to change when the language changes. Sam. First, thank you for your consideration. I only load a template for a

Re: [htmltmpl] RFC: Conditional TMPL_INCLUDE

2005-01-07 Thread Mark Fuller
s be more or less efficient than me performing my own re-evaluation of things that otherwise would be default values (i.e., the problem mentioned in the previous paragraph)? Thanks! Mark - Original Message - From: "Keith Jackson" <[EMAIL PROTECTED]> To: "Sam Tr

Re: [htmltmpl] RFC: Conditional TMPL_INCLUDE

2005-01-07 Thread Mark Fuller
From: "Sam Tregar" <[EMAIL PROTECTED]> > On Fri, 7 Jan 2005, Mark Fuller wrote: > > However, if you think it would be useful to have a "persistent evaluation" > > of the *cached* template (so that the partially-evaluated template is > > returned w

Re: [htmltmpl] RFC: Conditional TMPL_INCLUDE

2005-01-05 Thread Mark Fuller
From: "Keith Jackson" <[EMAIL PROTECTED]> > On Wed, 2005-01-05 at 01:58, Mathew Robertson wrote: > > http://members.optusnet.com.au/mathew/ > > Your version has some nice features that I could use, especially the recursive HTML::Template invocation. Is there a reason why Sam has not included your

Re: [htmltmpl] RFC: Conditional TMPL_INCLUDE

2005-01-04 Thread Mark Fuller
Here's another example. To accomodate multiple foreign languages I store my loaded templates in a hash keyed by language code. The loaded template is mostly the same template files with param information filled in specific to the language. My procedure is this: I always check if the template exist

Re: [htmltmpl] RFC: Conditional TMPL_INCLUDE

2005-01-04 Thread Mark Fuller
From: "Mathew Robertson" <[EMAIL PROTECTED]> > >which way is it? either you are providing choice or you're not. I'm sorry. I probably didn't explain the example very well. This example is somewhat a problem of nesting, and somewhat a problem of semi-static values. Let's say I have 20 different

[htmltmpl] RFC: Conditional TMPL_INCLUDE

2005-01-04 Thread Mark Fuller
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 applies the

Re: [htmltmpl] RFC: Template Tag Attributes

2004-06-03 Thread Mark Fuller
From: "Pete Prodoehl" <[EMAIL PROTECTED]> > I've seen sites where I could read a word on a page, input it into the > 'site search' box, and get no results. Some search/indexing tools exclude common and site-defined words. I used a really nice local indexing tool called WebGlimpse[1] and it had thi

Re: [htmltmpl] Whitespace (linefeed) suppression?

2004-05-11 Thread Mark Fuller
Thank you! That will work for me. I still think the unusual appearance of the solution points to something missing in H::T. But, I don't seem to be getting anywhere. :) Mark --- This SF.Net email is sponsored by Sleepycat Software Learn develo

Re: [htmltmpl] Whitespace (linefeed) suppression?

2004-05-11 Thread Mark Fuller
From: "Puneet Kishor" <[EMAIL PROTECTED]> > The thing is... it is so easy to get around this problem... as David > suggested... what is wrong with either html-tidy, or with s/\n\n/\n/g Nothing wrong with them. I only suggested it belongs in H::T. If the argument is that H::T shouldn't suffer the p

Re: [htmltmpl] Whitespace (linefeed) suppression?

2004-05-11 Thread Mark Fuller
From: "Sam Tregar" <[EMAIL PROTECTED]> > In my opinion, the problem is in your expectation. HTML::Template > gives you back exactly what you put in the template, ... > ... I consider this to be outside the scope of HTML::Template. I'm sorry. I was hoping you'd see the legitimacy of my suggestion.

Re: [htmltmpl] Whitespace (linefeed) suppression?

2004-05-11 Thread Mark Fuller
From: "Puneet Kishor" <[EMAIL PROTECTED]> > IMO, logic should belong in the > script, not in the H-T markup, else it will become like php or > coldfusion. The control tags (tmpl_if, tmpl_unless, etc.) provide basic > programmatic control in the markup, but enough is enough, in my view. It seems l

Re: [htmltmpl] Whitespace (linefeed) suppression?

2004-05-11 Thread Mark Fuller
From: "petersm" <[EMAIL PROTECTED]> > Why should this matter (besides the bandwidth issue)? HTML ignores whitespace > and other than looking at the output of a template every now and then to make > sure that it is what you want, why do you care what the output looks like? Why take bandwidth off th

Re: [htmltmpl] Whitespace (linefeed) suppression?

2004-05-11 Thread Mark Fuller
From: "David Hodgkinson" <[EMAIL PROTECTED]> > There are mod_perl and apache filters for doing this. mod_gzip makes it > particularly > academic if you're prepared to trade a little CPU for a *lot* of > bandwidth. > > Stuff in the right place. I don't agree with the assertion that mod_perl is the

[htmltmpl] Whitespace (linefeed) suppression?

2004-05-11 Thread Mark Fuller
If I have something like this for readability in the template: == Error: (Forgot your password? Reset and email it to yourself.) The resulting HTML has a lot of newlines. I'd like to ask if there should'nt be a

Re: [htmltmpl] Select/option How to set "selected"?

2004-05-03 Thread Mark Fuller
Matthew, I don't understand what's wrong with Jason's example. If DBI yields a result in the format HTML::Template understands, what's wrong with taking advantage of that? How would you change his example to make it more indirect and abstract? I love HTML::Template. Especially in combination with

Re: [htmltmpl] Select/option How to set "selected"?

2004-05-03 Thread Mark Fuller
port your quest to keep it clean and fast!). Mark ----- Original Message - From: "Sam Tregar" <[EMAIL PROTECTED]> To: "Mark Fuller" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Monday, May 03, 2004 8:42 PM Subject: Re: [htmltmpl] Select/option How to s

[htmltmpl] Select/option How to set "selected"?

2004-05-03 Thread Mark Fuller
I am creating a select list where all the "option" content comes from a mySQL table. The following works fine: Occupation: How can I specify a row should be "selected"? The TMPL_VAR named "VAL" is a numeric index. If I could use TMPL_IF and concatenat

Re: [htmltmpl] Select/option How to set "selected"?

2004-05-03 Thread Mark Fuller
Thanks. That will work perfectly. Mark - Original Message - From: "Puneet Kishor" <[EMAIL PROTECTED]> To: "Mark Fuller" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Monday, May 03, 2004 2:13 PM Subject: Re: [htmltmpl] Select/option How to

Re: [htmltmpl] Select/option How to set "selected"?

2004-05-03 Thread Mark Fuller
latter would be more efficient? If I am already testing my criteria for selected, then I don't have to do an "if" again in the HTML. In other words, is it more efficient to resolve the variable contents, or to test variable? Mark ----- Original Message - From: "Jason Purdy&qu

Re: [htmltmpl] A valid reason for template support for select lists?

2003-10-21 Thread Mark Fuller
>From: "Sam Tregar" <[EMAIL PROTECTED]> > > Or, is it customary to ask the user and do gettext based > > upon their answer? > > Sorry, I don't. Here's what I'd do if I needed to find out: I did a lot of searching and reading. I think HTML::Template can be useful when serving multi-lingual pages t

Re: [htmltmpl] A valid reason for template support for select lists?

2003-10-19 Thread Mark Fuller
>From: "Sam Tregar" <[EMAIL PROTECTED]> > > ... or you need to go to some kind of gettext-style > i18n database. You might need that anyway, for error messages and > other generated text. I wasn't familiar with that. I've been out reading anything I can find in search results and I think you're r

Re: [htmltmpl] A valid reason for template support for select lists?

2003-10-19 Thread Mark Fuller
> From: "Sam Tregar" <[EMAIL PROTECTED]> > Are you saying you can't do this now? I've produced boxes > with HTML::Template. It requires a nasty pile of logic but > it's doable. Hi Sam. Yes, I think "tmpl_if" will work. The problem I have is that my templates will be organized by spoken languag

[htmltmpl] A valid reason for template support for select lists?

2003-10-19 Thread Mark Fuller
I just found html::template and it's exactly what I was looking for. The only thing that is a minor shortcoming for me is the inability to do option select lists. I understand the emphasis on keeping a template a template (and languages separate). But, here's an example of why I believe it is justi