Hi Bill -
On Fri, Dec 5, 2014, at 09:56 AM, Bill McCormick wrote:
okay, so now the bitwise *and* is giving me problems:
input class=radio type=radio name=recipe_type value=Warmup [%
'checked=1' IF 15 16 %]/Warmup
You're doing logical AND, not bitwise AND. You want 15 16.
Larry
Hi Summer -
I want to omit the tags and everything in between.
[% customBlock = BLOCK;
'customTag';
A BUNCH OF TT STUFF
'/customTag'
%]
[%
newString = customBLOCK.replace((?i:customTag[.*?]/customTag),);
%]
First, I think to do the case-insensitive matching you need to have
(?i)
Hi Gabor -
On Tue, Jun 4, 2013, at 08:37 AM, Kiss Gabor (Bitman) wrote:
Dear folks,
After one and half document reading and web search I can't figure
out how to include all files from a directory relative to the
main template.
This may help you find the current directory for the current
Hi Summer -
[% some_name; token_to_omit =1 %]
some_name does not respect that variable token_to_omit
Did you try:
[% PROCESS some_name token_to_omit=1 %]
(No semicolon after some_name.)
http://www.template-toolkit.org/docs/manual/Directives.html#section_BLOCK
HTH,
Larry
Hi Stuart -
It is a hashref. I just trimmed it down to the minimum that causes the
error. To be more clear:
[% x = { constants.foo = value } %]
Or:
[% function({ constants.foo = value }) %]
Maybe want something like:
[%
foo = constants.foo;
x = { $foo = value };
Hi Khalid -
my $tt = Template-new( {
VARIABLES = {
username = 'Simba',
},
RELATIVE = 1,
} ) || die $Template::ERROR\n;
I think you want CONSTANTS, not VARIABLES.
HTH,
Larry
___
templates mailing list
Hi Wayne -
Recently I noticed that while ttree is processing the .tt files into
.html quite fine, it is no longer copying over the ancillary files.
Is it possible it thinks they are old and do not need copying? What
happens if you touch the file so it looks new?
Just a guess...
Larry
Hi Todd -
On Thursday, September 08, 2011 8:31 PM, Todd Wade
tr...@sbcglobal.net wrote:
touch lets the system set the permissions, File::Temp sets the mode of
the file explicitly.
Is that accurate?
Not exactly...
It's true that File::Temp sets the mode of the file explicitly, because
it
Hi Todd -
I'm not seeing a umask being applied when File::Temp creates the file:
$ umask
0002
$ perl -MFcntl -e 'sysopen(my $fh, ./sysopened, O_WRONLY | O_APPEND |
O_CREAT, 0600)'
$ ls -l
-rw--- 1 me me 0 Sep 9 10:35 sysopened
It is being applied, it just doesn't do anything.
On Fri, 19 Aug 2011 13:50 +0100, Dave Howorth
dhowo...@mrc-lmb.cam.ac.uk wrote:
Andrew Black wrote:
[...]
if myvar != 5 print STDERR 'myvar should be 5, actual $myvar'
[...]
Dunno, did you try typing template assert into google, which shows
Hi Dave -
items = some_resultset_rs.all ;
IF items.size 0;
'ul' ;
FOREACH item IN items ;
'li' ; item.name ;
END ;
'/ul' ;
END ;
and I've tried using items.0.defined but all my attempts work when there
are zero items and when there are two or more items, but fail
Hi John -
The following does not work:
a href=[% c.uri_for_action(/gallery/show, $name) %]
In template code if you are outside a quoted string you do not need the
dollar sign to get the value of a variable. So here you just need:
a href=[% c.uri_for_action(/gallery/show, name) %]
If
Note: In English, we don't use a, b, and c, but a, b and c
Not necessarily: http://en.wikipedia.org/wiki/Serial_comma
___
templates mailing list
templates@template-toolkit.org
http://mail.template-toolkit.org/mailman/listinfo/templates
Hi -
Adding [% USE dumper; dumper.dump(authors); -%], then it appears:
$VAR1=[];
Authors: ARRAY(0x9ff9278)
With:
[% FOREACH author IN authors %]
trtd
[% author || No author here %]
/td/tr
nothing appears.
Your authors array is empty. That is why dumper reports it as []
and also
Try [% authors.size %] and it will likely show up as zero.
It outputs 0.
I fill array in following way in .cgi script.
my $vars = {
authors = \...@authorslog;
}
Missing semicolon at end of this line?
$tt2-process('page.html', $vars) || die $tt2-error();
@authorslog is not
Hi Summer -
On Tue, 20 Apr 2010 22:09 -0400, Darren Chamberlain
d...@sevenroot.org wrote:
On Tue, Apr 20, 2010 at 21:57, Summer crazysummer2...@yahoo.com wrote:
FOREACH newstr IN thistxtstring.split( '||' );
split takes a regex, so you need to escape the |:
FOREACH newstr IN
server
{
stuff
[% INCLUDE thing %]
}
where thing has
Foo
Bar
and end up with
server
{
stuff
foo
bar
}
is there anyway to get it so that it is
server
{
stuff
foo
bar
}
How about something like (untested):
server
{
stuff
[%-
Hi Octavian -
Is it possible to define a macro in a single place and access it in
all the templates?
[cut]
Now I just need to find how I can include this in Catalyst...
You should be able to put variables, MACROs and BLOCK definitions in a
file like my_config_stuff.tt, and then do
On Thu, 03 Sep 2009 13:41 +0200, Alexander Dahl p...@lespocky.de
wrote:
I don't think books from the last century will help you in questions of
modern web design. There's XHTML now and CSS and browsers have gone
through evolutional steps since then. For example: you don't use hidden
tables or
Hi Bill -
On Thu, 09 Jul 2009 11:31 -0700, Bill Moseley mose...@hank.org
wrote:
On Thu, Jul 9, 2009 at 3:16 PM, Bill Ward b...@wards.net wrote:
Anyway you probably should be using not ' for the HTML
attributes there, to avoid that problem...
[cut]
and ' are both ok to use
Ok in
On Thu, 09 Jul 2009 12:48 -0700, Sean McAfee eef...@gmail.com wrote:
On Thu, Jul 9, 2009 at 3:39 PM, Larry Leszczynski
lar...@emailplus.orgwrote:
Hi Bill -
On Thu, 09 Jul 2009 11:31 -0700, Bill Moseley mose...@hank.org
wrote:
and ' are both ok to use
Ok in HTML but not XHTML
Hi Kelly -
On Mon, 16 Feb 2009 15:40 -0500, Kelly Thompson
kalexthomp...@gmail.com wrote:
I see no reason to have external js links, with a template system, other
than hiding code.
Back in the day, it was nice to be able to edit one js file, and all
pages change. With Templates that's
Hi Kelly -
On Sun, 18 May 2008, Kelly Thompson wrote:
I am trying to create a MACRO that will replace a lot of values
within a databased variable. What I have now is this in my config
template.
Your macro is multiple lines, try enclosing in a BLOCK, e.g.:
[% MACRO unescape(text) BLOCK;
On Fri, 18 Jan 2008, Andy Wardley wrote:
Thanks to everyone for the information about editor bundles,
and thanks especially to all the people who wrote them. I've
added a list to the TT2 web site.
http://tt2.org/download/index.html#editors
Another to add: I've been happy using the TT
On Sun, 19 Nov 2006, Buddy Burden wrote:
We use OpenThought (http://www.openthought.net/) with TT2.
[snip]
I understand that CGI::Application works well with TT2, but I don't know
how difficult it would be to convince the OT code to do that.
I have an app built with TT2 and
Hi Birgit -
I should add that the same template works perfectly with loop.first,
except that then of course it doesn't do what I want :-)
Sorry this does not solve the question of the loop.last error message,
but if loop.first works maybe you could do something like:
% foreach record in
On Fri, 17 Feb 2006, Nik Clayton wrote:
This is an idle musing, prompted in part by
http://www.tbray.org/ongoing/When/200x/2006/02/14/AJAX-Performance
Has anyone ever considered implementing a Javascript engine for the TT
syntax? I rather fancy the idea of offloading the template processing
On Thu, 16 Feb 2006, Andy Wardley wrote:
With '-' and '+' it's fairly clear (once you know what they do) that '-'
removes whitespace and '+' leaves it alone. The same is also true of '='
for collapsing, if you think of it as two '-' signs with a space between
them. That's also analogous to
Hi Gernot -
and where mytemplate.txt looks like
[% c %]
[% FOREACH x = c %]
[% x %]
[% END %]
Did you mean :
[% FOREACH x IN c %]
?
Larry
___
templates mailing list
templates@template-toolkit.org
On Fri, 16 Dec 2005, Phil Mitchell wrote:
Yes, I did PROCESS my macros.tt, but it was inside header.tt, which got
INCLUDED. Changing the outer inclusion to PROCESS solved. I'm coming to the
conclusion that I should PROCESS everything, and leave INCLUDE for
optimization time ...
Actually,
On Thu, 27 Oct 2005, Randy Kobes wrote:
Yes, I saw it at cpan.uwinnipeg.ca, but no PPM. That's why I wanted to ask
if anyone had built one before submitting a request.
Actually, I did see this messsage, and put up a ppm
package under http://theoryx5.uwinnipeg.ca/ppms/.
It'll be reflected
On Tue, 15 Mar 2005, Cahill, Earl wrote:
A start with a line, say
This line is really too long.
A length, say 25, and suffix, say '...'. I would like to be able to do
something like this
[% my_truncate(line, 25, '...') %]
And end up with
This line is really t...
Um, maybe you
On Mon, 7 Mar 2005, Perrin Harkins wrote:
Cahill, Earl wrote:
1. TT parses the page and does all tags, except those containing a
priority
2. I get, say, an array ref of hash refs, corresponding to the tags
for an entire page (since priorities don't necessarily match
Time), Larry
Leszczynski [EMAIL PROTECTED] wrote:
Hi j -
is there a way to Dump the hash passed into your template from within
your template?
-j
http://template-toolkit.org/docs/default/Modules/Template/Plugin/Dumper.html
HTH,
Larry
Hi j -
is there a way to Dump the hash passed into your template from within
your template?
-j
http://template-toolkit.org/docs/default/Modules/Template/Plugin/Dumper.html
HTH,
Larry
___
templates mailing list
templates@template-toolkit.org
control the scoping).
So even with Andy's fix to make the localization done by INCLUDE less of a
performance hit (which sounds very cool), it might still be worth
considering making INCLUDE default to not localize, or add some syntax to
allow the user explicitly control the variable scope.
Larry
as the difference between CGI and PersistentPerl.
Is there any way to take advantage of the cache in a non-persistent (e.g.
non-webserver) environment? Maybe along the lines of serializing the
template object and reading it back later?
Just curious,
Larry Leszczynski
Hi Perrin -
Is there any way to take advantage of the cache in a non-persistent (e.g.
non-webserver) environment? Maybe along the lines of serializing the
template object and reading it back later?
No, but the COMPILE_DIR option means that at least the compile to perl
step will be
want to make it safe to put in an HTML page).
HTH,
Larry Leszczynski
___
templates mailing list
[EMAIL PROTECTED]
http://lists.template-toolkit.org/mailman/listinfo/templates
the template that does the prepare/execute.
Is there some sort of dereferencing or eval-ing that I need to do to get
the bind_params list passed through to execute?
Thanks,
Larry Leszczynski
___
templates mailing list
[EMAIL PROTECTED]
http://lists.template
40 matches
Mail list logo