Hi,

In the past I've only used TT for "application" type sites; or on
sites where others have done the templates.

Now I am working on a site where most of the content is just "simple
data".

I would like to use a wrapper for the pages, not entirely unlike
the PROCESS configuration directive would allow me to.

However, I need to define some of the data inside the real template
file.  Some of it can be set via META, but other things are either
dynamic or Just Too Big to not get clunky as a meta tag.

What I have done for now, in a simplified example:

foo.html:

[% PROCESS tpl/common/header.html %]
[% banner = BLOCK %]foo bar baz[% END %]
[% sidebar = BLOCK %]
... some sidebar text ...
[% END%]

bla bla bla, real content goes here, bla bla blah

[% PROCESS tpl/common/footer.html %]

header.html:
[% UNLESS banner; banner = "Default Foo: " _ title; END;
<html>
...
[% banner %]
[% sidebar %]
...


What I would like to do:

  A) Not have to call header and footer in each "real" file.
     o) Still be able to "skip" the header and footer, I can
        hack that with CLEAR and STOP.  Are there any nicer
        ways to do it?

  B) Instead of doing [% foo = BLOCK %]...[% END %] have a
     "real" [% BLOCK foo %]... block, but still have it be optional
     without having header.html croak out when the block has not
     been defined.  (And be able to tweak the data in the
     header.html file).


B) would mostly just be to be able to keep [% PROCESS header.html %]
on the first line of the file, so if I can do A, then B doesn't
matter so much.



 - ask

ps. In related news then I'm getting the templates from a Subversion
server via http.  More on that some other time.

-- 
ask bjoern hansen, http://www.askbjoernhansen.com/ !try; do();

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

Reply via email to