Hi everyone,
a question about frontend development. I've been experimenting with
the CSS/JS nodes in my resources folder and theme definition. One of
the things i'm currently trying to implement is to write aggregator
freemarker templates for CSS/JS to easily organize my CSS and JS files
in folders and then aggregate them on the fly, which simplifies
development and also makes the site faster, because the browser only
needs to do two requests (for the combined CSS and JS files) instead
of a request for every single file. I've included the template at the
bottom of this mail, maybe it is useful for somebody.

To make development even more easier it would be very helpful if there
would be some way to do a 'recursive bypass' for all files included
using the template. You can use the 'bypass' flag on the file dialog
to load files from the filesystem, so you can edit the CSS/JS files in
your favourite editor instead of using the dialog. However, when
checking the bypass flag on the aggregated freemarker template it only
bypasses this single file, and you still have to set the flag on all
child nodes. This was to be expected, but i was just wondering if
there is some way to solve this problem so you can have a good
development setup.

Thanks,
-- Hay Kranen, frontend developer VPRO Netherlands

My aggregator template:

[#--
    This Freemarker template aggregates all files recursively, even in
    subfolders, and cats them all together, with some nice descriptive comments
    and compresses it on the fly as well
--]

[#macro recurseTree parent]
    [#list parent ? children as child]
        [#if child ? node_type == "mgnl:folder"]
            /********* ${child} (${chi...@handle}) ********/
            [...@recursetree child /]
        [#else]
            /* ${child} (${chi...@handle}) */
            ${mgnl.renderTemplate(child)}
        [/#if]
    [/#list]
[/#macro]

[#-- Start recursing --]
[#compress]
    [...@recursetree content /]
[/#compress]

----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------

Reply via email to