in reply to Creating reports with HTML::Template and CGI::Application
To answer your second question first, have someone who is a good HTML designer design a calendar page for you in HTML. It will have rows and columns.
Now alter the design by reducing all the rows to one, but put that inside a TMPL_LOOP:
And then simply assign appropriate values to the positions in each row such that the days of the month align properly with days of the week (leaving empty spaces at the start or at the end, as appropriate).<table> <TMPL_LOOP name="calendar"> <tr> <td><TMPL_VAR name="sideheader"></td> <td <TMPL_IF name="holiday_1">bgcolor="mauve" </TMPL_IF>> <TMPL_VAR name="day_1"> </td> <td <TMPL_IF name="holiday_2">bgcolor="mauve" </TMPL_IF>> <TMPL_VAR name="day_2"> </td> <!-- ETC for the rest of the row --> </tr> </TMPL_LOOP> </table>
Come to think of it, the same method would work for the first table - in fact there it's easy to see that it's months going along the row, so you can give your columns more intuitive names.
One last thing. When making links, I prefer to use a cleaned up self_url from CGI.pm, and have <TMPL_VAR>s in the HTML. That way, the script and template will work, even if they are moved into another directory, or to another server.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Can I do this???
by bar10der (Beadle) on Mar 03, 2004 at 16:57 UTC |