On Wed, Apr 2, 2014 at 1:45 PM, Summer crazysummer2...@yahoo.com wrote:
I am getting:
plugin error - Math: plugin not found at /application/
It is odd. I am wondering if it is being omitted on startup or something.
What base plugins DO you have installed? They should be in a
On Wed, Apr 2, 2014 at 12:20 PM, Summer crazysummer2...@yahoo.com wrote:
I am really looking for a way to generate a random number, whole, from 0 -
100. I look thru the docs, don't see anything.
You want the Math module. This template snippet will output a whole number
between 0 to 99
On Wed, Apr 2, 2014 at 1:16 PM, Summer crazysummer2...@yahoo.com wrote:
When I try to USE Math; I get a stack trace, so I assume I don't have it.
That doesn't logically follow. What does the stack trace say?
When I [% USE Foo %] I don't get a stack trace, I get the helpful error
message
On Fri, Jan 31, 2014 at 1:15 PM, Rajeev Prasad rp.ne...@yahoo.com wrote:
hello,
my template is getting variable: userLevel
this is then used to call a document like this:-
[% INCLUDE mainmenu.$userLevel %]
Just put quotes around the entire template name:
[% INCLUDE mainmenu.$userLevel
On Tue, Mar 1, 2011 at 12:48 PM, Bill Ward b...@wards.net wrote:
I know we can use a filter to convert to lower case, [% foo | lower %] but
that only works for output. What I want is to do a case-insensitive [% IF
%] test, and normally in Perl I would just lc($foo) and compare that to the
On Tue, Mar 1, 2011 at 1:14 PM, Bill Ward b...@wards.net wrote:
On Tue, Mar 1, 2011 at 1:04 PM, Sean McAfee eef...@gmail.com wrote:
On Tue, Mar 1, 2011 at 12:48 PM, Bill Ward b...@wards.net wrote:
I know we can use a filter to convert to lower case, [% foo | lower %]
but that only works
On Tue, Mar 1, 2011 at 1:53 PM, Sean McAfee eef...@gmail.com wrote:
For a pure-TT solution, you could use a temporary variable:
[% temp = BLOCK; FILTER lc; XXX; END; END; IF temp == xxx; ... %]
Of course I meant to write FILTER lower here
On Tue, Mar 1, 2011 at 1:56 PM, Sean McAfee eef...@gmail.com wrote:
On Tue, Mar 1, 2011 at 1:53 PM, Sean McAfee eef...@gmail.com wrote:
For a pure-TT solution, you could use a temporary variable:
[% temp = BLOCK; FILTER lc; XXX; END; END; IF temp == xxx; ... %]
Of course I meant to write
On Tue, Mar 1, 2011 at 2:14 PM, Bill Ward b...@wards.net wrote:
The issue here is that my database values are all lowercase, but I wanted
to display a menu in mixed case, and have the currently selected value
appear in lowercase as well as the value attribute of the option tag be
the
On Tue, Sep 14, 2010 at 7:09 AM, Josh803316 josh803...@gmail.com wrote:
My question:
Is there any way to process python inside the PERL block or any plugin that
allows for a [% PYTHON %] block.
Do people use Inline::Python for this or is there another way?
An implementation of the
On Mon, Mar 1, 2010 at 9:18 PM, Jim Battle frus...@pacbell.net wrote:
# save 'content' to tmp file
my $tmp = lib/tmp.css;
open(FH, $tmp) or die Couldn't open $!;
print FH $context-stash()-get('content');
close(FH);
# filter the tmp file, sending
2009/11/4 Hendrik T. Völker basicb...@basicbaer.de
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Hi guys,
I have a problem regarding data defined inside the META tag.
For example I have the following at the start of a template file:
- ---8---
[%= META
dest = '/etc/motd'
user
On Thu, Oct 22, 2009 at 1:23 AM, Simon Wilcox es...@ourshack.com wrote:
So, it's not a bug in TT per se, i.e. it's not a regression, it's always
been this way but it is a change in behaviour caused by a change
*elsewhere*. The subsequent question is whether TT should change to
suppress the
On Thu, Oct 22, 2009 at 9:56 AM, Bill Moseley mose...@hank.org wrote:
On Thu, Oct 22, 2009 at 9:50 AM, Sean McAfee eef...@gmail.com wrote:
Another useful thing might be to introduce a configuration option or two
that provide more control over which warnings can be generated by evaluated
On Thu, Oct 22, 2009 at 11:10 AM, Bill Moseley mose...@hank.org wrote:
On Thu, Oct 22, 2009 at 10:20 AM, Sean McAfee eef...@gmail.com wrote:
You're *not* able to do that. Template::Document localizes away whatever
warning hook the main application might have installed.
TT $VERSION
On Wed, Oct 14, 2009 at 4:07 AM, hemanth reddy hemd...@gmail.com wrote:
[%str=somedata® same data%]
[%str%]
output:somedata® same data
how to escape special characters while prinitng (example  in the above
example )at template level without any perl code help
no regular expressions
2009/10/12 Octavian Râşniţă orasn...@gmail.com
Hi,
Is it possible to define a macro in a single place and access it in all the
templates?
For example, I want to create a macro for translation, which would be
needed
in all the templates and it would be nice if it wouldn't be necessary to
On Wed, Sep 30, 2009 at 12:00 PM, Felipe Gasper (cPanel)
fel...@cpanel.netwrote:
Sweet!
Did I just not find this in my RTFM'ing, or is it not documented?
It would seem not to be documented.
A non-backslash alternative might be to set up a hash of subroutine
references somewhere, and then
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. XHTML says you *must* use double quotes
around your attribute values, single
On Mon, May 11, 2009 at 6:14 PM, Yanick Champoux yan...@babyl.dyndns.orgwrote:
Clayton Scott wrote:
Try this instead:
[% SET b = a 0 ? 1 : 0 %]
or drop the SET which isn't really necessary
[% b = a 0 ? 1 : 0 %]
Or drop the ternary operator as well, which is also not
On Wed, May 6, 2009 at 4:42 AM, Kiffin Gish kiffin.g...@planet.nl wrote:
Is there an environment variable I can use for enabling debugging for
template toolkit, e.g. export TEMPLATE_DEBUG=1?
No such environment variable exists, but you could easily incorporate one
into your application, eg:
On Thu, Apr 30, 2009 at 11:56 AM, Chris Travers chris.trav...@gmail.comwrote:
Is there a preferred way to pass data containing the '/' through the
grep vmethod?
I can't get grep to match presumably due to string interpolation
issues. THe issue is that the data I am trying to match is
On Wed, Apr 29, 2009 at 7:56 AM, Harald Joerg
harald.jo...@ts.fujitsu.comwrote:
Bill Moseley mose...@hank.org writes:
[%
'div class=login';
PROCESS login_form
'/div';
%]
For TT2's parser, this is equivalent to:
div class=login
[%- PROCESS login_form '/div' %]
Indeed,
On Sat, Apr 11, 2009 at 1:32 PM, Kelly Thompson kalexthomp...@gmail.comwrote:
In the line: newDate = ${dateArray.0}${dateArray.1}${weekDys.0 -1};
I have tried.
newDate = ${dateArray.0}${dateArray.1}+(${weekDys.0} -1);
newDate = ${dateArray.0}${dateArray.1}${${weekDys.0} -1};
newDate =
On Tue, Apr 7, 2009 at 4:16 PM, Howard Ashreed quies...@gmail.com wrote:
If anybody is able to help I have one other question. As I said, we're
trying to translate our website into other languages and make it easier for
volunteers to do the translations without having to read over lots of
On Tue, Apr 7, 2009 at 6:12 AM, Lyle Brooks bro...@deseret.com wrote:
Sometimes I'd like to give ttree a directory as an argument and have
it recusively process all files in that directory tree. It seems as if
currently you can either have it process everything via the -a option, or
ask it
On Sun, Apr 5, 2009 at 3:23 PM, John Bida bida.j...@mayo.edu wrote:
Is there a way to use the INCLUDE directive but only copy specific
variables from the stash? I want to limit the global variables the
included template sees.
Not out of the box. One of the cleaner ways to accomplish that
On Thu, Nov 13, 2008 at 10:58 AM, Todd Rinaldo [EMAIL PROTECTED] wrote:
My question: Is there any easy way to make a recursive block that can
test if an unpredictably deep hash is defined?
Perhaps, but it would be easier to write a routine in Perl:
sub nested {
my ($hash, @keys) = @_;
On Thu, Nov 13, 2008 at 3:09 PM, Todd Rinaldo [EMAIL PROTECTED] wrote:
On Thu, Nov 13, 2008 at 2:05 PM, Sean McAfee [EMAIL PROTECTED] wrote:
On Thu, Nov 13, 2008 at 10:58 AM, Todd Rinaldo [EMAIL PROTECTED] wrote:
My question: Is there any easy way to make a recursive block that can
test
On Thu, Oct 30, 2008 at 9:43 AM, Michael Wichmann [EMAIL PROTECTED]wrote:
| Mihai Bazon wrote:
|
| I for one don't quite understand why/how you want to use this, but
| probably a simple way is to use a variable:[% SET condition =
| something | eval; IF condition %] ... [% END %]
|
On Mon, Oct 20, 2008 at 12:26 PM, Andy Wardley [EMAIL PROTECTED] wrote:
Perrin Harkins wrote:
If performance is a consideration, Sean's will be better than using
AUTOLOAD.
One of my favorite tricks in this situation is to have the AUTOLOAD
generate
the method (or in this case, alias to
On Sat, Oct 18, 2008 at 12:39 PM, Mihai Bazon [EMAIL PROTECTED] wrote:
Thanks. It's not very orthodox if you ask me, but it's a good solution, in
lack of anything else. :-) The idea is that I would be more interested in a
deny all but allow a few solution, rather than deny a few, allow
On Sat, Oct 18, 2008 at 9:51 AM, Mihai Bazon [EMAIL PROTECTED] wrote:
Hi folks,
I have an application where I want to allow end-users to write templates
but I don't want them to get access to all the available directives. For
instance I want to prevent them from using PROCESS / INCLUDE /
On Wed, Oct 8, 2008 at 3:38 PM, Sean Allen [EMAIL PROTECTED]wrote:
have the following at the top of tons of templates...
[% USE Number::Format( thousands_sep = ',', decimal_point = '.',
int_curr_symbol = '', decimal_digits = '2', decimal_fill = 't' ) -%]
is there a way to use LOAD_PLUGINS
Oh-- and it also works for me when I run it under perl -d, if that's what
you meant by the debugger.
--Sean
On Fri, Oct 3, 2008 at 12:51 AM, Sean McAfee [EMAIL PROTECTED] wrote:
On Mon, Sep 29, 2008 at 2:12 AM, Sönke Barkow [EMAIL PROTECTED] wrote:
Hello @ll!
I'm not sure if this mailing
On Mon, Sep 15, 2008 at 6:29 AM, Birgit Kellner [EMAIL PROTECTED]
wrote:
Hi,
in an older version of the Template Toolkit (we just updated our server
to 2.19), using % if loop.last % threw an error that could be solved
through a hack in Iterator.pm, sub AUTOLOAD:
$item = 'LAST' if $item eq
Question for all, but mainly Andy:
I've been contacted by a party interested in using the Python implementation
of TT2, who requests that its copyright and licensing status be made less
ambiguous throughout the source. He suggests a LICENSE file at the top
level and a brief copyright notice in
On Mon, Sep 15, 2008 at 8:56 AM, Clinton Gormley [EMAIL PROTECTED]wrote:
Hi all
Quick survey : what file extensions do you typically use for your TT
templates?
- .tt
- .html
- ???
I inherited an environment where HTML templates have a single .tt extension,
and other templates may have
Well, coincidentally I found myself needing to solve the same problem as the
OP. I replaced some template inputs that had been plain numbers with
objects (implemented in the standard fashion as a reference to a hash) that
perform some basic caching, and that reduce to numbers via use overload.
I
On Mon, Jul 28, 2008 at 4:07 AM, Marc Chantreux [EMAIL PROTECTED]
wrote:
hello,
I tried to register a vmethod to an object using this way:
use strict;
use warnings;
use Template;
use Template::Stash;
$Template::Stash::SCALAR_OPS-{field} = sub {
my $self = shift;
On Mon, Jul 28, 2008 at 10:10 AM, Sean McAfee [EMAIL PROTECTED] wrote:
On Mon, Jul 28, 2008 at 4:07 AM, Marc Chantreux
[EMAIL PROTECTED] wrote:
hello,
I tried to register a vmethod to an object using this way:
use strict;
use warnings;
use Template;
use Template::Stash;
$Template
On Mon, Jul 28, 2008 at 3:13 PM, Marc Chantreux [EMAIL PROTECTED]
wrote:
hello Sean,
I'm afraid it does the same ...
I'm not sure what you mean. Here's a less abbreviated example:
use Template;
use Template::Stash;
use strict;
package Object;
sub new {
my ($class, $addend) = @_;
On Sun, Jul 13, 2008 at 10:23 PM, [EMAIL PROTECTED] wrote:
Dear All,
I'm planning to develop a system that public users can fully change the
template by their own.
I'm concerning about security, how can I turn off some plugins or load only
what I need?
Derive your own plugin
On Mon, Jun 30, 2008 at 10:11 AM, Blue Eyed Devil
[EMAIL PROTECTED] wrote:
To reiterate my example:
[% TAG %] is a [% TYPE %] that can be [% WORD %]
If I don't pass any vars to process(), there should be a collection,
property, or method I could call that would work something like:
On Mon, Jun 30, 2008 at 11:15 AM, Blue Eyed Devil
[EMAIL PROTECTED] wrote:
The reasons as to why a particular feature is desired/needed may not be
evident until the need presents itself. This would be one of such times.
Maybe something along the lines (semi-pseudocode):
...
my
On Thu, Jun 26, 2008 at 5:53 AM, Andy Wardley [EMAIL PROTECTED] wrote:
Krassimir Berov wrote:
I just wanted to inform you that the syntax highlighting support for
Template Toolkit is already distributed by default with the editor.
That's great. I've updated the web site. Many thanks.
On Mon, Jun 23, 2008 at 12:10 PM, Keddie, Diane [EMAIL PROTECTED] wrote:
When creating a template object, the default for the LOAD_PERL
configuration parameter is 0. According to the template toolkit manual,
this option can be set to 1 to allow you to load regular Perl modules as
plugins.
On another mailing list, someone was perplexed that the TT2 mailing list
archives only go up to September 2007, and that his requests to be added to
this list were unsuccessful. The archive and subscription pages he cited
were, respectively,
http://template-toolkit.org/mailman/listinfo/templates
On Mon, Mar 17, 2008 at 6:14 AM, Thomas Klausner [EMAIL PROTECTED] wrote:
Hi!
I'm currently trying to pass some arbitrary values (basically a list)
through a macro:
[% MACRO mt(msg) GET c.maketext(msg) %]
[% mt(Hello %1, c.user.name %]
[% mt(%1 does %2, 'foo', 'bar' %]
The problem ist
On Tue, Mar 11, 2008 at 6:51 AM, Sean Allen [EMAIL PROTECTED] wrote:
On Mar 10, 2008, at 9:05 PM, Sean McAfee wrote:
On Mon, Mar 10, 2008 at 5:29 PM, Sean Allen [EMAIL PROTECTED] wrote:
We are getting ready to embark on porting a bunch of old code ( and
several hundred TT templates
On Mon, Mar 10, 2008 at 11:26 AM, Rick [EMAIL PROTECTED] wrote:
The datafile plugin was the first thing I looked at. However the datafile
plugin creates a hash, and the HTML tables I needed to generate seemed to
flow naturally from an array of arrays structure.
What I need to learn (I think)
On Mon, Mar 10, 2008 at 5:29 PM, Sean Allen [EMAIL PROTECTED] wrote:
We are getting ready to embark on porting a bunch of old code ( and
several hundred TT templates ) to Python and plan on using template-
python to ease everything along. Anyone else but in any serious work
with the python
On Wed, Mar 5, 2008 at 2:46 PM, Chris Petersen [EMAIL PROTECTED]
wrote:
On Mar 5, 2008, at 12:40 PM, Andrew Marold wrote:
How about [% IF foo.match('(foo|bar)') %] ?
That would work, assuming you added anchors to the regex and I'm only
ever matching against static lists and not pre-defined
On Thu, Feb 28, 2008 at 8:14 PM, Sherwood Botsford [EMAIL PROTECTED]
wrote:
[% FOREACH section IN
[ 'Home', 'Trees', 'Advice', 'Our_Forests', 'Links' ]
%]
td style=width: 15%;
[% IF $template.name.search($section) %]
bi$section/i/b
[% ELSE %]
On Jan 25, 2008 9:45 AM, Rodney Broom [EMAIL PROTECTED] wrote:
From: Tosh Cooey [EMAIL PROTECTED]
This isn't working
Needs to come out as:
quot;This isnapos;t workingquot;
Unless I'm missing something:
[% var_to_escape | html %]
The point is that the html filter doesn't do
On Jan 23, 2008 10:12 PM, Kelly Thompson [EMAIL PROTECTED] wrote:
I concur.
Other than that, I lOVE TT. Really.
One more thing, you mentioned in the badger book, about creating your own
virtual methods, but you didn't show how to use them.
For instance, I wanted to add substr to a
On Jan 19, 2008 3:33 AM, Andy Wardley [EMAIL PROTECTED] wrote:
Hi Sean,
ok( $text =~ /back is . '#ff'/, 'col.back folded' );
Oops! Mea Culpa.
I think prototypes aren't generally a good idea, so I'd go for the
latter
approach.
Sounds good.
I'd like to
propose that
In the course of translating the Template Toolkit into Python, I accumulated
a small(ish) list of issues I noticed with the Perl version. Most are
minor--documentation issues and the like--but a few are more serious.
Here's one of them, from t/constants.t:
ok( $text =~ /back is . '#ff'/,
This message is to let folks know that the Python implementation of the
Template Toolkit, on which I've been working for some time, is complete.
Almost all unit tests from the Perl version have been translated into
Python, typically with little or no substantive modification required, and
all
Hi folks--
Just wanted to let everyone know that development of the Python port of the
Template Toolkit has been continuing apace. I've been translating the unit
tests as time permits,
On Aug 8, 2007 11:01 AM, Sean McAfee [EMAIL PROTECTED] wrote:
Hi folks--
Just wanted to let everyone know that development of the Python port of
the Template Toolkit has been continuing apace. I've been translating the
unit tests as time permits,
Jeez, sorry about that... I inadvertently
~ smcafee$ svn co svn://svn.tt2.org/Template2/trunk Template2
subversion/libsvn_ra_svn/client.c:141: (apr_err=61)
svn: Can't connect to host 'svn.tt2.org': Connection refused
--Sean
Hi all--
I've uploaded my preliminary Python TT implementation to the repository
described by Andy. I'll continue to work on it, but now everyone else can
now have at it also!
I'll be happy to discuss the project here on this list.
--Sean
On 5/4/07, Andy Wardley [EMAIL PROTECTED] wrote:
!
--Sean
On 4/20/07, Andy Wardley [EMAIL PROTECTED] wrote:
Sean McAfee wrote:
I'm about ready to put a lot more eyes on it, if there's any interest.
So, is there?
Hi Sean,
I think this is a great idea. You've certainly got my full support.
I can set up an SVN repository when you're ready
On 4/20/07, Andy Wardley [EMAIL PROTECTED] wrote:
Sean McAfee wrote:
I'm about ready to put a lot more eyes on it, if there's any interest.
So, is there?
Hi Sean,
I think this is a great idea. You've certainly got my full support.
I can set up an SVN repository when you're ready
On 4/3/07, Darren Chamberlain [EMAIL PROTECTED] wrote:
On 4/3/07, Sean McAfee [EMAIL PROTECTED] wrote:
So, not much interest has been expressed in my proposal so far--not
surprisingly, since I imagine this audience doesn't include many regular
Python users. I wish I wasn't one myself
Hi folks--
So, not much interest has been expressed in my proposal so far--not
surprisingly, since I imagine this audience doesn't include many regular
Python users. I wish I wasn't one myself. However, I still think a Python
implementation for the Template Toolkit would be a great thing to
On 3/22/07, Josh Rosenbaum [EMAIL PROTECTED] wrote:
It would be nice to have a tag to control the chomping method in TT
similar to the
TAGS directive. (ie: [% TAGS ! ! %])
I'm thinking:
[% PRE_CHOMP CHOMP_NONE %]
[% POST_CHOMP CHOMP_ALL %]
or maybe:
[% CHOMP CHOMP_NONE CHOMP_ALL %]
or:
[%
On 3/19/07, Josh Rosenbaum [EMAIL PROTECTED] wrote:
As long as it follows specs along with changes to the specs, it is
increasing adoption and portability of TT. That seems like a good thing to
me.
Well, I'd certainly expect the Python implementation to pass the same array
of tests as the
On 3/15/07, Johan Vromans [EMAIL PROTECTED] wrote:
Sean McAfee [EMAIL PROTECTED] writes:
I guess I'm about ready to put a lot more eyes on it, if there's any
interest. So, is there?
I'm not a Python user so I may not be your target audience, but I
think it is a very good thing to have
Hi folks--
I posted here last year asking for information on a Python templating system
of comparable power to the Template Toolkit (as Perl is tragically a
non-starter at my workplace). No such system seems to exist.
Well, I recently pondered transforming a program that produces HTML output
to TT for Python?
I guess I could want until Perl 6 and its advertised interoperability
with Python, but I have a hunch that's still a ways off.
Thanks in advance for any help.
--Sean McAfee
___
templates mailing list
templates@template-toolkit.org
;
}
The references returned by fetchrow_{array,hash}ref are all references to
the *same* array or hash, so if you did this you'd wind up with an array of
multiple references to the same hash, containing the last row returned by
the query.
--
Sean McAfee -- [EMAIL PROTECTED
73 matches
Mail list logo