[Templates] dynamic META information

Tony Bowden tony-tt@kasei.com
Fri, 22 Mar 2002 16:46:34 +0000


I have all templates being wrapped in a standard way through a PROCESS
config argument, that does basic stuff like:

[% PROCESS macros/base;
   DEFAULT wrapper = template.wrapper or 'comp/wrapper/blank';
   SET browser_title = template.browser_title
                     ? "MySite: $template.browser_title"
                     : "MySite";

   PROCESS comp/header;
   PROCESS $template WRAPPER $wrapper;
   PROCESS comp/footer;
%]

And, within the comp/header template I have something like:

  <html>
  <head>
    <title>[% browser_title %]</title>

So, that in any given page's template I can do:
  [% META browser_title = "My Page" %]

This all works great.

Until I want to make the browser title be something to do with some data
that the template gets, such as:
  [% META browser_title = book.title %]

Which of course doesn't work as this info has to be a plain string.

I'm assuming there must be _some_ way to make this work though?

Tony