perl-embperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Derrick Spell <derricksp...@cdmplus.com>
Subject Re: Apparent Nesting Problem
Date Wed, 27 Apr 2005 20:06:58 GMT

On Apr 25, 2005, at 11:54 PM, Ben Kim wrote:

>> 		[$ if ($background eq 1) $]<tr style="background: #ccc;">[$ else
>> $]<tr>[$ endif $]
>> 		[- $background = !$background -]
>
> I had a simlar problem when I upgraded from 1.3 to 2.0.
>
> You should honor the table structure first and fit conditions or loops
> around it. I.e. you should arrange the ifs and loops so that when they 
> are
> removed, the table structure should make sense.
>
> I.e.
> <table>[$if$]<tr>...</tr>[$endif$]</table> => Removing [$if$][$endif$]
> should make a proper table.

That's the key right there.  I didn't realize the tables worked this 
way, but it's a very good thing to know and keep in mind while I'm 
developing.


>
> A simple fix will be like:
>
>   <tr [$ if ($background eq 1) $]style="background: #ccc;"[$ endif $]>
>

Bingo!  Thanks a lot.

-Derrick



---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Mime
View raw message