Re: [Templates] Passing variables to a [%.. %]

2012-01-16 Thread Jason Galea
check out https://metacpan.org/module/DBIx::Inline I haven't actually used it, but it looks like a good lead in to my preferred ORM, https://metacpan.org/module/DBIx::Class if you can't see how you'd use that you might need to post the code you are using to process the templates to make it easier

Re: [Templates] Passing variables to a [%.. %]

2012-01-15 Thread Jason Galea
++ certainly. I just thought I'd give a little prod in the right direction.. 8) On Mon, Jan 16, 2012 at 9:06 AM, Bill Moseley wrote: > > > On Mon, Jan 16, 2012 at 1:58 AM, wrote: > >> >> Passing variblles into [% ... %] is a on going problem for me. >> >> a keyone is >> >> [% pagecode = data.pa

Re: [Templates] Passing variables to a [%.. %]

2012-01-15 Thread Jason Galea
[% query = 'SELECT * FROM page_tb WHERE (status = 2 AND page_code = " _ data.page_name + '" AND sitename = "' _ data.sitename _" ) ORDER BY sitename' %] [% FOREACH link = DBI.query( query ) %] [% site = link.sitename%] [% PageName = link.view_name %]

Re: [Templates] compile a template without rendering it?

2012-01-14 Thread Jason Galea
hmm.. it appears you could get a compiled template with $compiled = $tt->context->template('template.tt); but I'd have to ask why you would want/need to do this? cheers, J On Thu, Jan 12, 2012 at 7:18 AM, E R wrote: > Is there way to compile a template without rendering it? > > Ideally I'd

Re: [Templates] Variables within subroutine calls

2009-11-04 Thread Jason Galea
'=>' then your function should get the list it is expecting I think. cheers, J -- Jason Galea Web Developer Ph 07 40556926 Mob 04 12345 534 www.eightdegrees.com.au ___ templates mailing list templates@template-toolkit.org http://mail.template-toolkit.org/mailman/listinfo/templates

Re: [Templates] Preserving value of a variable in a snippet

2008-08-23 Thread Jason Galea
use PROCESS instead of INCLUDE to do this I think.. Andrew Black wrote: > As I understand it, when you call include it localises all variables, so > changes made inside the included file are discarded. > In general this is desirable > > I have a requirement for one or more templates (???) to hav

Re: [Templates] Any outstanding patches/issues for TT2?

2008-06-10 Thread Jason Galea
Hi Andy, When trying to parse a broken template more than once you get a parse error the first time and then a "not found" on subsequent attempts. Is this intentional? I can't really see it being a problem in normal use but I did just spend way too many hours trying to figure out how I'd broke

Re: [Templates] user overriding

2006-01-11 Thread Jason Galea
Hi Ashley, you can do this via your template config. my $template = Template->new({ INCLUDE_PATH => [ '/home/usr/html', '/usr/local/html' ], }); Put the users' directory first, followed by the default directory. TT will search the directories in order givi

Re: [Templates] how do I do $tt->process( $text_ref )

2004-07-29 Thread Jason Galea
But TT's process method takes a file name as argument, not a string. Do I have to understand how to subclass Template::Provider, Template::Document, and Template::Parser if I want to get this to work? the process method takes a file name, string ref, or GLOB.. http://search.cpan.org/~abw/Template-

Re: [Templates] Newbie Question re sort and hash iteration

2004-01-20 Thread Jason Galea
Hi David, well that's a new one by me.. I wouldn't have expected the first one to work, but it looks like sort is returning the keys of the hash.. I think this should work for you.. [% FOREACH n = school_details %] [% n.key %][% n.value %] [% END %] and by the looks of things, that will s