Hi Daniel,
If you use HTML::Template::Expr (rather than H::T), you can move the 'flag' code into
the template itself, thus decoupling the presentation of 5 images per row, from the
Perl logic, by doing:
<TMPL_LOOP...>
<TMPL_IF EXPR(="__counter__ % 5) == 1">
<tr ...>
</TMPL_IF>
<td ...>
<a href...
</td>
<TMPL_IF EXPR(="__counter__ % 5) == 0">
</tr>
</TMPL_IF>
</TMPL_LOOP>
Also, you can make '5' a TMPL_VAR if needed.
regards,
Mathew
----- Original Message -----
From: "Daniel Wiener" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, February 11, 2004 9:15 AM
Subject: [htmltmpl] No image tag in IE6
> Hello. I have used and appreciated this list a great deal and now have a question.
> It may not be caused by anything related to Html-Template but if nothing else I want
> to remove it from the list of suspects.
>
> The problem is that certain configurations of IE6 is not writing an image tag in a
> loop.
>
> Explanation and code fragments below ->
>
>
> My template looks like this:
>
> <!-- table for letters -->
> <table border="0" cellpadding="0" cellspacing="1">
> <tr valign="top" align="center"><tmpl_loop ROWS>
> <td bgcolor="#ffffff"><p><a href="/monogram/<TMPL_VAR NAME=NAME>.html"><img
> src="/letter/<TMPL_VAR NAME=NAME>/<TMPL_VAR NAME=NAME>_<TMPL_VAR NAME=LETTER>.gif"
> width="125" height="125" border="0"><br>
> <TMPL_VAR NAME=LONGNAME> <TMPL_VAR NAME=SET_NUMBER></a><br>
> <a
> href="http://www.digitalriver.com/dr/v2/ec_MAIN.Entry17c?SP=10007&CID=0&SID=13528&PN=21&PID=<TMPL_VAR
> NAME=DR_LINK>" class="black">Purchase This Letter</a></p>
> </td>
> <tmpl_if name=flag>
> </tr><tr valign="top" align="center">
> </tmpl_if>
> </tmpl_loop ROWS>
> </tr>
> </table>
> <!-- end table for letters -->
>
>
> I create the loop in Perl like this:
>
> my $count = 1;
> my $rows = ();
> while ( $href = $sth->fetchrow_hashref() ) {
>
> next if $href->{name} =~ /hebrew|greek/;
> $href->{dr_link} = $href->{$letter};
> if($count == 5) {
> $href->{flag} = 1;
> $count = 0;
> }
> push (@{$rows}, $href);
> $count++;
> }
>
>
> This url:
> http://www.embroideryarts.com/cgi-bin/intarsia/letter.cgi?letter=n
> should create a grid of n's.
>
> And it does in every browser and every platform but not in certain configurations
> (as yet to be determined) of IE6.
>
> The html (when retrieved from View Source) it writes for all browsers but IE6 is:
>
> <table border="0" cellpadding="0" cellspacing="1">
> <tr valign="top" align="center">
> <td bgcolor="#ffffff"><p><a href="/monogram/alphabet.html"><img
> src="/letter/alphabet/alphabet_n.gif" width="125" height="125" border="0"><br>
> Alphabet </a><br>
> <a
> href="http://www.digitalriver.com/dr/v2/ec_MAIN.Entry17c?SP=10007&CID=0&SID=13528&PN=21&PID=1153708"
> class="black">Purchase This Letter</a></p>
> </td>
>
> etc. etc. to create a table...
>
> The html (when retrieved from View Source) the script writes in IE6 is:
> <table border="0" cellpadding="0" cellspacing="1">
> <tr valign="top" align="center">
> <td bgcolor="#ffffff"><p><a href="/monogram/alphabet.html"><br>
> Alphabet </a><br>
> <a
> href="http://www.digitalriver.com/dr/v2/ec_MAIN.Entry17c?SP=10007&CID=0&SID=13528&PN=21&PID=1153708"
> class="black">Purchase This Letter</a></p>
> </td> etc.
>
> NO IMAGE TAG AT ALL. ??
>
> I cannot figure this out. It may be an IE6 problem unrelated to Html-Template but
> any help with this would be much appreciated.
>
> Thank you
>
> Daniel Wiener
>
>
>
>
> --
> Daniel Wiener | 156 Hoyt Street | Brooklyn, NY 11217 | 718.858.1107
> http://www.danielwiener.com
>
>
> -------------------------------------------------------
> The SF.Net email is sponsored by EclipseCon 2004
> Premiere Conference on Open Tools Development and Integration
> See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
> http://www.eclipsecon.org/osdn
> _______________________________________________
> Html-template-users mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/html-template-users
>
-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
Html-template-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/html-template-users