Kiran Kumar wrote:
Hi All,
I am a newbie to TT and would like some inputs
Implementing the below mentioned
Currently in our application we have a html_wrapper()
method that returns a generated header string and
footer string (header and footer are heredocs and
interpolated variables), and the individual
application (cgi scripts) generates the page content
as a string. The actual page is built by either
printing the header, content and footer in succession,
or interpolating the header and footer into the top
and bottom of the content string.
Been there done that. Still suffering from it. ( Soon to become TT
based ).
But the newer stuff is done like this
A header.tt and footer.tt file. Then several different .tt files
depending on the page returned that look like this
[% PROCESS header.tt %]
<div id="main">
<!-- Lots of nifty XHTML -->
[% # with TT stuff where needed %]
</div>
[% PROCESS footer.tt %]
This allows me to open the main file with a browser and get a pretty
good idea of what the page will look like. Or allow someone else to
design the main layout and putting [% var %] and other stuff where
needed. A fair amount of separation of display from proccessing.
I mostly do forms so this works well. YMWV
Rod
--
_______________________________________________
templates mailing list
[email protected]
http://lists.template-toolkit.org/mailman/listinfo/templates