Thread: [htmltmpl] No image tag in IE6
Brought to you by:
samtregar
From: Daniel W. <da...@da...> - 2004-02-10 22:11:17
|
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 |
From: Mathew R. <mat...@re...> - 2004-02-10 22:36:13
|
Some possiblilties for this to be the case, is: a) you are not generating the <img...> tag in the first place = (unlikely), b) you have one of those 'ad blockers' installed; which strip out = suspect <img...> tags. The easiest way to find out - using the machine on which IE6 doesn't = produce the img tag, print the $template->output() to a file, before = sending to a browser. This will confirm that the <img...> is being = produced. Then its a matter of finding out which blocker is installed. Hope this helps, Mathew ----- Original Message -----=20 From: "Daniel Wiener" <da...@da...> To: <htm...@li...> 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. >=20 > The problem is that certain configurations of IE6 is not writing an = image tag in a loop. >=20 > Explanation and code fragments below -> >=20 >=20 > My template looks like this: >=20 > <!-- table for letters --> > <table border=3D"0" cellpadding=3D"0" cellspacing=3D"1"> > <tr valign=3D"top" align=3D"center"><tmpl_loop ROWS>=20 > <td bgcolor=3D"#ffffff"><p><a href=3D"/monogram/<TMPL_VAR = NAME=3DNAME>.html"><img src=3D"/letter/<TMPL_VAR NAME=3DNAME>/<TMPL_VAR = NAME=3DNAME>_<TMPL_VAR NAME=3DLETTER>.gif" width=3D"125" height=3D"125" = border=3D"0"><br> > <TMPL_VAR NAME=3DLONGNAME> <TMPL_VAR NAME=3DSET_NUMBER></a><br> > <a = href=3D"http://www.digitalriver.com/dr/v2/ec_MAIN.Entry17c?SP=3D10007&CID= =3D0&SID=3D13528&PN=3D21&PID=3D<TMPL_VAR NAME=3DDR_LINK>" = class=3D"black">Purchase This Letter</a></p> > </td> > <tmpl_if name=3Dflag> > </tr><tr valign=3D"top" align=3D"center"> > </tmpl_if> > </tmpl_loop ROWS>=20 > </tr> > </table> > <!-- end table for letters --> > =20 > =20 > I create the loop in Perl like this: >=20 > my $count =3D 1; > my $rows =3D (); > while ( $href =3D $sth->fetchrow_hashref() ) { >=20 > next if $href->{name} =3D~ /hebrew|greek/; > $href->{dr_link} =3D $href->{$letter}; > if($count =3D=3D 5) { > $href->{flag} =3D 1; > $count =3D 0; > } > push (@{$rows}, $href); > $count++; > } >=20 >=20 > This url: > http://www.embroideryarts.com/cgi-bin/intarsia/letter.cgi?letter=3Dn > should create a grid of n's. >=20 > And it does in every browser and every platform but not in certain = configurations (as yet to be determined) of IE6. >=20 > The html (when retrieved from View Source) it writes for all browsers = but IE6 is: >=20 > <table border=3D"0" cellpadding=3D"0" cellspacing=3D"1"> > <tr valign=3D"top" align=3D"center">=20 > <td bgcolor=3D"#ffffff"><p><a href=3D"/monogram/alphabet.html"><img = src=3D"/letter/alphabet/alphabet_n.gif" width=3D"125" height=3D"125" = border=3D"0"><br> > Alphabet </a><br> > <a = href=3D"http://www.digitalriver.com/dr/v2/ec_MAIN.Entry17c?SP=3D10007&CID= =3D0&SID=3D13528&PN=3D21&PID=3D1153708" class=3D"black">Purchase This = Letter</a></p> > </td> >=20 > etc. etc. to create a table... >=20 > The html (when retrieved from View Source) the script writes in IE6 = is: > <table border=3D"0" cellpadding=3D"0" cellspacing=3D"1"> > <tr valign=3D"top" align=3D"center">=20 > <td bgcolor=3D"#ffffff"><p><a href=3D"/monogram/alphabet.html"><br> > Alphabet </a><br> > <a = href=3D"http://www.digitalriver.com/dr/v2/ec_MAIN.Entry17c?SP=3D10007&CID= =3D0&SID=3D13528&PN=3D21&PID=3D1153708" class=3D"black">Purchase This = Letter</a></p> > </td> etc. >=20 > NO IMAGE TAG AT ALL. ?? >=20 > I cannot figure this out. It may be an IE6 problem unrelated to = Html-Template but any help with this would be much appreciated. >=20 > Thank you=20 >=20 > Daniel Wiener >=20 >=20 >=20 >=20 > -- > Daniel Wiener | 156 Hoyt Street | Brooklyn, NY 11217 | 718.858.1107 > http://www.danielwiener.com >=20 >=20 > ------------------------------------------------------- > 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 > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/html-template-users > |
From: Mathew R. <mat...@re...> - 2004-02-10 22:43:24
|
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(=3D"__counter__ % 5) =3D=3D 1"> <tr ...> </TMPL_IF> <td ...> <a href... </td> <TMPL_IF EXPR(=3D"__counter__ % 5) =3D=3D 0"> </tr> </TMPL_IF> </TMPL_LOOP> Also, you can make '5' a TMPL_VAR if needed. regards, Mathew ----- Original Message -----=20 From: "Daniel Wiener" <da...@da...> To: <htm...@li...> 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. >=20 > The problem is that certain configurations of IE6 is not writing an = image tag in a loop. >=20 > Explanation and code fragments below -> >=20 >=20 > My template looks like this: >=20 > <!-- table for letters --> > <table border=3D"0" cellpadding=3D"0" cellspacing=3D"1"> > <tr valign=3D"top" align=3D"center"><tmpl_loop ROWS>=20 > <td bgcolor=3D"#ffffff"><p><a href=3D"/monogram/<TMPL_VAR = NAME=3DNAME>.html"><img src=3D"/letter/<TMPL_VAR NAME=3DNAME>/<TMPL_VAR = NAME=3DNAME>_<TMPL_VAR NAME=3DLETTER>.gif" width=3D"125" height=3D"125" = border=3D"0"><br> > <TMPL_VAR NAME=3DLONGNAME> <TMPL_VAR NAME=3DSET_NUMBER></a><br> > <a = href=3D"http://www.digitalriver.com/dr/v2/ec_MAIN.Entry17c?SP=3D10007&CID= =3D0&SID=3D13528&PN=3D21&PID=3D<TMPL_VAR NAME=3DDR_LINK>" = class=3D"black">Purchase This Letter</a></p> > </td> > <tmpl_if name=3Dflag> > </tr><tr valign=3D"top" align=3D"center"> > </tmpl_if> > </tmpl_loop ROWS>=20 > </tr> > </table> > <!-- end table for letters --> > =20 > =20 > I create the loop in Perl like this: >=20 > my $count =3D 1; > my $rows =3D (); > while ( $href =3D $sth->fetchrow_hashref() ) { >=20 > next if $href->{name} =3D~ /hebrew|greek/; > $href->{dr_link} =3D $href->{$letter}; > if($count =3D=3D 5) { > $href->{flag} =3D 1; > $count =3D 0; > } > push (@{$rows}, $href); > $count++; > } >=20 >=20 > This url: > http://www.embroideryarts.com/cgi-bin/intarsia/letter.cgi?letter=3Dn > should create a grid of n's. >=20 > And it does in every browser and every platform but not in certain = configurations (as yet to be determined) of IE6. >=20 > The html (when retrieved from View Source) it writes for all browsers = but IE6 is: >=20 > <table border=3D"0" cellpadding=3D"0" cellspacing=3D"1"> > <tr valign=3D"top" align=3D"center">=20 > <td bgcolor=3D"#ffffff"><p><a href=3D"/monogram/alphabet.html"><img = src=3D"/letter/alphabet/alphabet_n.gif" width=3D"125" height=3D"125" = border=3D"0"><br> > Alphabet </a><br> > <a = href=3D"http://www.digitalriver.com/dr/v2/ec_MAIN.Entry17c?SP=3D10007&CID= =3D0&SID=3D13528&PN=3D21&PID=3D1153708" class=3D"black">Purchase This = Letter</a></p> > </td> >=20 > etc. etc. to create a table... >=20 > The html (when retrieved from View Source) the script writes in IE6 = is: > <table border=3D"0" cellpadding=3D"0" cellspacing=3D"1"> > <tr valign=3D"top" align=3D"center">=20 > <td bgcolor=3D"#ffffff"><p><a href=3D"/monogram/alphabet.html"><br> > Alphabet </a><br> > <a = href=3D"http://www.digitalriver.com/dr/v2/ec_MAIN.Entry17c?SP=3D10007&CID= =3D0&SID=3D13528&PN=3D21&PID=3D1153708" class=3D"black">Purchase This = Letter</a></p> > </td> etc. >=20 > NO IMAGE TAG AT ALL. ?? >=20 > I cannot figure this out. It may be an IE6 problem unrelated to = Html-Template but any help with this would be much appreciated. >=20 > Thank you=20 >=20 > Daniel Wiener >=20 >=20 >=20 >=20 > -- > Daniel Wiener | 156 Hoyt Street | Brooklyn, NY 11217 | 718.858.1107 > http://www.danielwiener.com >=20 >=20 > ------------------------------------------------------- > 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 > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/html-template-users > |
From: Mathew R. <mat...@re...> - 2004-02-10 22:52:46
Attachments:
Filters.pm
|
Hi list, A little while ago, I asked people for implementations of various = filters that are used, so that we could create a module which contains = generic filters. Well here it is.... Attached is a module which = implements some generic filters. If anyone has others that they would = like added, please send them to me. regards, Mathew |
From: Timm M. <tm...@ag...> - 2004-02-11 14:07:56
|
At 09:50 AM 2/11/04 +1100, Mathew Robertson wrote: >Hi list, > >A little while ago, I asked people for implementations of various filters >that are used, so that we could create a module which contains generic >filters. Well here it is.... Attached is a module which implements some >generic filters. If anyone has others that they would like added, please >send them to me. I'm glad somebody took the time to do this. A little constructive criticism: --Use of $_ should be avoided in modules. It's easy to screw up the localization and clobber existing values of $_ in code higher up. This can be solved either by using a regular variable, or by explicitly localizing it. --When you create the string used to match tags, it will be faster to wrap it in a qr// instead of a simple string. This will cause perl to compile the regex once instead of repeatedly compiling it at runtime whenever the string is interpolating into the s///. Otherwise, I like it. Thanks, Timm |
From: Mathew R. <mat...@re...> - 2004-02-12 01:34:34
Attachments:
Filters.pm
|
> --Use of $_ should be avoided in modules. It's easy to screw up the=20 > localization and clobber existing values of $_ in code higher up. = This can=20 > be solved either by using a regular variable, or by explicitly = localizing it. done > --When you create the string used to match tags, it will be faster to = wrap=20 > it in a qr// instead of a simple string. This will cause perl to = compile=20 > the regex once instead of repeatedly compiling it at runtime whenever = the=20 > string is interpolating into the s///. done In the process, I found: - a bug or two in the TMPL_SET code - I changed the way regex's work for case sensitivity, which should = result in faster regex parsing. cheers, Mathew |