Click here to get back home

HTML::Template, is it possible to nest inside a ?

 HomeNewsGroups | Search | About
 comp.lang.perl.modules    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
HTML::Template, is it possible to nest inside a ? Val Schuman 06-04-2007
Posted by Val Schuman on June 4, 2007, 4:58 pm
Please log in for more thread options


trying to do <TMPL_IF <TMPL_VAR myvar>>do something</TMPL_IF>
is something like this possible? if not, any workarounds?


Posted by Bianka Martinovic on June 5, 2007, 4:35 am
Please log in for more thread options


Val Schuman schrieb:
> trying to do <TMPL_IF <TMPL_VAR myvar>>do something</TMPL_IF>
> is something like this possible? if not, any workarounds?
>
You want to do this (I think):

<TMPL_IF NAME="myvar">
do something
</TMPL_IF>

This prints "do something" if "myvar" is set. If not, the whole block
will be deleted.

Greetings, Bianka

Posted by Paul Lalli on June 6, 2007, 7:00 am
Please log in for more thread options


wrote:
> Val Schuman schrieb:> trying to do <TMPL_IF <TMPL_VAR myvar>>do
something</TMPL_IF>
> > is something like this possible? if not, any workarounds?
>
> You want to do this (I think):
>
> <TMPL_IF NAME="myvar">
> do something
> </TMPL_IF>
>
> This prints "do something" if "myvar" is set. If not, the whole
> block will be deleted.

It prints "do something" if "myvar" is set *to a true value*. If it's
set to 0 or "", the block will be skipped.

Paul Lalli


Posted by google.20.cerberus on June 28, 2007, 4:36 am
Please log in for more thread options


>
> It prints "do something" if "myvar" is set *to a true value*. If it's
> set to 0 or "", the block will be skipped.
>
That's what I meant. ;)

Greetings, Bianka



Posted by Tim Berke on June 12, 2007, 10:15 am
Please log in for more thread options


Val Schuman wrote:
> trying to do <TMPL_IF <TMPL_VAR myvar>>do something</TMPL_IF>
> is something like this possible? if not, any workarounds?
>

Not exactly what you are looking for I think but a loop inside a loop example
(working).
Tim


<HTML>
<HEAD>
<TITLE><TMPL_VAR NAME="title"></TITLE>
</HEAD>
<BODY bgcolor="skyblue">
<H1>
<center><dt><b><i><font size="+8">
<TMPL_VAR NAME="title">
</font></i></b></dt></center>
</H1>
<TABLE BORDER=1>
<TR>
<TMPL_LOOP NAME="heading_loop">
<TH><FONT size="+4"><TMPL_VAR NAME="head"></FONT></TH>
</TMPL_LOOP>
</TR>
<TMPL_LOOP NAME="body_loop">
<TR>
<TMPL_LOOP NAME="row">
<TD><FONT size="+2"><TMPL_VAR NAME="col"></FONT></TD>
</TMPL_LOOP>
</TR>
</TMPL_LOOP>
</TABLE>
</BODY>
</HTML>

Similar ThreadsPosted
HTML::Template March 5, 2008, 2:40 pm
HTML::Template and __ODD__ July 22, 2005, 7:48 am
HTML::Template not outputting February 25, 2008, 3:11 pm
Mixing HTML::Template and GD::Graph May 14, 2005, 8:53 am
Namespace for new module: HTML::Template::HTX? May 13, 2005, 7:17 pm
HTML::Template arbitraryily nested recursive loops April 8, 2005, 2:59 pm
install HTML::Template - Problem reading cache file / Bad file number July 24, 2004, 7:55 pm
Is it possible to use a custom perl binary inside a prebuilt apache/mod_perl environment? April 24, 2007, 5:15 pm
A do-file location: how the code inside that do-file find it? January 20, 2008, 12:32 am
[RFC] HTML::Dashboard (Spreadsheet-like formatting for HTML tables) April 16, 2007, 4:50 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap