Hi Marvin,

I'd use a model class rather than a filter. You can set a model class in the 
"Advanced" tab for a Resource. The default is

info.magnolia.module.templatingkit.resources.STKResourceModel

You could write a model-class that inherits from this, and provides a method 
like

public String minify(String jsText){ ... }

Then, looking at the "all.js" resource as an example, you could simply write 
the template as:

[#list content?children as subnode]
    ${model.minify(subnode.text?interpret!"")}
[/#list]

or something along those lines...

Of course you have to write the function minify(), that's the real trick.... 
maybe YUICompressor or a similar library will be of help for that.

Regards from Vienna,

Richard



Von: [email protected] [mailto:[email protected]] 
Im Auftrag von Marvin Kerkhoff
Gesendet: Mittwoch, 28. März 2012 09:37
An: Magnolia User-List
Betreff: [magnolia-user] AW: Compressed CSS into once

Good Morning,

ok i fined a way to compress all into one File like the example of js file 
scriptloaders. But is it possible to minify that automaticly. For example over 
magnolia filter chain.

Thanks
Marvin

________________________________
Von: [email protected]<mailto:[email protected]> 
[mailto:[email protected]]<mailto:[mailto:[email protected]]>
 Im Auftrag von Marvin Kerkhoff
Gesendet: Mittwoch, 28. März 2012 09:00
An: Magnolia User-List
Betreff: [magnolia-user] Compressed CSS into once

Good Morning,

did any one know how it is easily possible to minify all CSS and JS Code into 
one Filerequest? Is it part of the Templating Kit?

Kind regards

Marvin Kerkhoff

Novanet Solutions AG - Forward Thinking

_________________________________________________________________

Technoparkstrasse 1, CH-8005 Zurich, 
http://www.novanet-solutions.ch<http://www.novanet-solutions.ch/>

E-Mail: [email protected]<mailto:[email protected]>
Direct: +41-44 515 04 56
Zentrale: +41-44 515 04 50


________________________________
----------------------------------------------------------------
For list details, see http://www.magnolia-cms.com/community/mailing-lists.html
Alternatively, use our forums: http://forum.magnolia-cms.com/
To unsubscribe, E-mail to: 
<[email protected]<mailto:[email protected]>>
----------------------------------------------------------------

________________________________
----------------------------------------------------------------
For list details, see http://www.magnolia-cms.com/community/mailing-lists.html
Alternatively, use our forums: http://forum.magnolia-cms.com/
To unsubscribe, E-mail to: 
<[email protected]<mailto:[email protected]>>
----------------------------------------------------------------


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

Reply via email to