[Templates] Processing Variables as templates

[prev] [thread] [next] [Date index for 2004/08/06]

From: Harry Jackson
Subject: [Templates] Processing Variables as templates
Date: 14:35 on 06 Aug 2004
I need some way to be able to do the following.

We fetch some data from a database that is to be displayed on a page. In 
order to get a couple of buttons ie Edit and Admin I append the 
following here document to the page as follows.

     while($sth->fetchrow_array()) {

         $variables->{CONTENT_NAME} = <<EOF;
[% IF Edit_Authority == "yes" %]
     [% Content_Id = $content_id %]
     [% INCLUDE admin/editor.t %]
[% END %]
EOF
         $variables->{CONTENT_NAME} .= $content;
     }

This variable is then used in a page as follows.

<snip>
     <div id="mainContent">
         [% CONTENT_NAME %]
    </div>
</snip>

What I want is for TT to process the contents of the variable before it 
is displayed. I am sure I have read something simialar to this in the 
Badger book.

Harry

_______________________________________________
templates mailing list
templates@xxxxxxxxxxxxxxxx.xxx
http://lists.template-toolkit.org/mailman/listinfo/templates

[Templates] Processing Variables as templates
Harry Jackson 14:35 on 06 Aug 2004

Re: [Templates] Processing Variables as templates
Darren Chamberlain 14:41 on 06 Aug 2004

Re: [Templates] Processing Variables as templates
Harald Joerg 14:53 on 06 Aug 2004

Generated at 08:55 on 15 Mar 2005 by mariachi v0.52