Click here to get back home

HTML::Template and __ODD__

 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 and __ODD__ Colin Walls 07-22-2005
Get Chitika Premium
Posted by Colin Walls on July 22, 2005, 7:48 am
Please log in for more thread options


I have the following code in one of my template files

<tbody id='interfaceData'>
<!-- TMPL_LOOP NAME="interfaceData" -->
<tr <!-- TMPL_IF NAME="__ODD__" -->class="alternateRow"<!-- /TMPL_IF --> >
<td><!-- TMPL_VAR NAME="interface" --></td>
<td><!-- TMPL_VAR NAME="if_type_description" --></td>
<td>
<a href='efs.cgi?rm=listInterfaceDetails;&amp;interface_id=<!--
TMPL_VAR NAME="interface_id" -->'
class='button'>Details</a>
</td>
</tr>
<!-- /TMPL_LOOP -->
</tbody>

The loop works, all the variables insert properly. The only thing that
doesn't happen is the alternate row class style being applied to odd rows
in the table. All I get is the tag "<tr >" appearing on each row.

Could anyone clue me up as to where I am going wrong?

--
Colin Walls

Remove the pink meat to mail me


Posted by James Taylor on July 22, 2005, 12:56 pm
Please log in for more thread options


>
> The loop works, all the variables insert properly. The only thing that
> doesn't happen is the alternate row class style being applied to odd
> rows in the table. All I get is the tag "<tr >" appearing on each row.
>
> Could anyone clue me up as to where I am going wrong?

Your code looks fine to me so my deduction would be that the __ODD__
is not present and that's why you're getting a blank in the "<tr >".
The most obvious cause of this would be that you've forgotten to set
the loop_context_vars parameter to a true value when calling
HTML::Template->new() or one of its sisters.

By the way, there's a mailing list for HTML::Template here:
http://lists.sourceforge.net/lists/listinfo/html-template-users

--
James Taylor, London, UK PGP key: 3FBE1BF9
To protect against spam, the address in the "From:" header is not valid.
In any case, you should reply to the group so that everyone can benefit.
If you must send me a private email, use james at oakseed demon co uk.



Posted by Colin Walls on July 22, 2005, 9:20 pm
Please log in for more thread options


James Taylor wrote:
> Your code looks fine to me so my deduction would be that the __ODD__
> is not present and that's why you're getting a blank in the "<tr >".
> The most obvious cause of this would be that you've forgotten to set
> the loop_context_vars parameter to a true value when calling
> HTML::Template->new() or one of its sisters.

Thanks for that, a case of RTFM. My only excuse is that I was using
templates via CGI::Application.

Mea culpa, mea culpa, mea maxima culpa.

--
Colin Walls

Remove the pink meat to mail me


Similar ThreadsPosted
HTML::Template March 5, 2008, 2:40 pm
HTML::template September 12, 2008, 10:52 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
HTML::Template, is it possible to nest inside a ? June 4, 2007, 4:58 pm
install HTML::Template - Problem reading cache file / Bad file number July 24, 2004, 7:55 pm
[RFC] HTML::Dashboard (Spreadsheet-like formatting for HTML tables) April 16, 2007, 4:50 pm
Template Toolkit Beautifer September 8, 2006, 2:22 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap