For our stuff we make sure that every page deals with all the header meta info that needs to be inherited as an array. Then dump the array out in the outermost wrapper.
For example:
outermost.ttml
----------------
... blah blah blah ...
<style type="text/css">
[%
DEFAULT styles = [];
styles.unshift('/css/au_basic.css');
styles.unshift('/css/au_global.css');
FOREACH style = styles.unique;
'@import url("' _ style _ '");' _ "\n";
END;
%]
</style>
... blah blah blah ...
[% content %]
... blah blah blah ...
----------------
somepage.ttml
----------------
[%
DEFAULT styles = [];
styles.unshift('/css/dept.css');
WRAPPER outermost.ttml;
.... some crud ....
END;
%]
----------------
You do that with scripts, css and in our case breadcrumbs and it works
out fairly easily.
Heck... you could even make a template to include in each one that would
propogate that for you. :P
Not as easy as a DOM aware templating engine... but it works well.
On Wed, Aug 02, 2006 at 11:23:17AM -0500, Evan Carroll wrote:
>
>
> My current configuration (and one I like a lot) is where I have a basic
> wrapper, loaded with the WRAPPER config param, and inside, of each other
> tt, the content of a container div is pulled. I want to optionally
> establish css/js files from the container div, ( or from the invocation
> args ), so what I'm looking for is the functionality of a META array.
>
> I would like to do something like this:
>
> [% META css = [qw/navbar.css horizontal.css main.css/ ] %]
>
> And, then when the wrapper pulls it in, loop over css and and puts those
> tags in the header, of the wrapper template. Auctualy, If I could be
> greedy, I would like subwrappers to be able to append to that list, so
> the navbar.tt, can pull its own style! But, I don't want to push my
> luck.
>
> Either way, META variables can't hold arrays so whats a good solution to
> accomplish this?
>
> Thanks in advance,
>
> Evan Carroll
> www.evancarroll.com
>
>
>
>
>
>
> _______________________________________________
> templates mailing list
> [email protected]
> http://lists.template-toolkit.org/mailman/listinfo/templates
--
Todd Freeman Ext 6103 .^. Don't fear the penguins!
Programming Department /V\
Andrews University // \\ http://www.linux.org/
http://www.andrews.edu/~freeman/ /( )\ http://www.debian.org/
^^ ^^
signature.asc
Description: Digital signature
