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 have a macros.tt file that defines this:


    page.style_sheet = [];

    MACRO include_style_sheet( name ) BLOCK;
        css_found = 0;
        FOR css = page.style_sheet;
            IF css == name;
                css_found = 1;
                LAST;
            END;
        END;
        page.style_sheet.push( name ) UNLESS css_found;
    END;

Then any bit of code could do this as needed:

    include_style_sheet( 'reports' );

Then my template that generates the html <head> section will create
the links to the style sheets.

I do the same for javascript.



-- 
Bill Moseley
[EMAIL PROTECTED]


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

Reply via email to