logo       

Re: Assembling a list of css/js/meta tags for WRAPPERs: msg#00004

Subject: Re: Assembling a list of css/js/meta tags for WRAPPERs
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
> templates-MnLy+PD7ppGDO3lXZvfOKmD2FQJk+8+b@xxxxxxxxxxxxxxxx
> 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/
                                        ^^ ^^

Attachment: signature.asc
Description: Digital signature

<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
boot-loaders.gr...    php.pear.genera...    debugging.valgr...    kde.redhat.user...    text.xml.xsl.ge...    culture.languag...    hardware.microc...    java.servicemix...    redhat.release....    web.zope.plone....    user-groups.lin...    opendarwin.webk...    video.mjpeg.use...    sysutils.bcfg2....    encryption.gpg....    lx-office.devel...    xfree86.forum/2...    mail.mutt.devel...    acpi.devel/2003...    qnx.openqnx.dev...    network.irc.irs...    freebsd.devel.m...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe