Currently I have an IF/ELSE block that determines if the loop.count is 
divisible by 2 and it sets the background color.

[% IF (loop.count % 2)  %]
        <tr id="trcol1">
            <td>[% report.DSTRCT_CODE %]</td>
            <td>[% report.WORK_ORDER %]</td>
            <td>[% report.CREATION_DATE %]</td>
            <td>[% report.LAST_MOD_DATE %]</td>
            <td>[% report.ORIGINATOR_ID %]</td>
            <td>[% report.SURNAME %]</td>
            <td>[% report.FIRST_NAME %]</td>
        </tr>
    [% ELSE %]
        <tr id="trcol2">
            <td>[% report.DSTRCT_CODE %]</td>
            <td>[% report.WORK_ORDER %]</td>
            <td>[% report.CREATION_DATE %]</td>
            <td>[% report.LAST_MOD_DATE %]</td>
            <td>[% report.ORIGINATOR_ID %]</td>
            <td>[% report.SURNAME %]</td>
            <td>[% report.FIRST_NAME %]</td>
        </tr>
    [% END %]

This is pulled using an SQL statement. I am trying to take into 
consideration those times when no data is pulled by the query. I thought 
maybe a SELECT/CASE would be a little cleaner but if the above could be 
modified that is fine. I have tried doing [if (loop.count < 1)] in various 
ways but it has not worked.

Since a SELECT/CASE block evaluates the SWITCH statement, I tried [% SWITCH 
loop.count %] but then I ran into how to check for equality.

Any suggestions to overcome my Perl limitations would be most welcome.

Thanks,

Robert 




_______________________________________________
templates mailing list
[EMAIL PROTECTED]
http://lists.template-toolkit.org/mailman/listinfo/templates

Reply via email to