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.

We are planning to move the current HTML to a template
using Template-Toolkit .

Here is one approach we are thinking of having a
template with  different blocks (not sure if this is
possible)
<template> 
[% BLOCK myblock1 -%]

   some [%var] here
 
[%END block1 %]
 
[% BLOCK myblock2 -%]

   some [%var] here
 
[%END block2 %]
 
[% BLOCK myblock3 -%]

   some [%var] here
 
[%END block %]
 
<end template> 

Can I do something like this for older scripts which
needs header and footer passed back

$header = $template->process("test.tt", Only block 1
,{data set} )
$footer = $template->process("test.tt", Only block 3
,{data set})

and for newer scripts which pass all the data .

$template->process("test.tt",{block1 , block2,
block3}{data set}); 

 Can this be done and what should I be looking at to
accomplish this .Any suggestions on how I can maintain
backward compatibility with the older scripts
 since we want to be able to build templates visualy
(eg view the template in the browser) we have to rule
out the option of Including different templates.

 Another approach we are thinking of is Template's
ability to define multiple tag delimiters and do a
two-pass process defining header and footer with [%
TAG %] and content with [* CONTENT *] (this will allow
us to split on CONTENT for backward compatibility)
 
 Thanks a lot . 
 
 
-Kiran

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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

Reply via email to