JavaScript and CSS minification

This is an implementation of a new tag for the OpenCms taglib that can automatically condense JavaScript and CSS code. The tag is used by enclosing a block of CSS of JavaScript with it, for example:

<cms:minify type="js">
function myFunc() {
  myVar = 123;
  alert( myVar );
}
</cms:jsminify>

The result in this case would be: "function myFunc(){a=123;alert(a)}"

The minification is done through the excellent Yahoo YUI compressor (http://developer.yahoo.com/yui/compressor/) which is also used by the jQuery project and which is, for example, able to condense variable names.

Module Version: 1.0
Provided By: Christian Steinert
License: LGPL
Click here to download (820 kb)

Download OpenCms

  • OpenCms 17 gives content managers the new app "Date search" to find content that has been changed in a certain time range. The "Websites" app allows to easily export the content of a complete site for archiving. An option has been added to hide "sensitive" content in the Offline project. The default Mercury template has been further improved, e.g. with SEO optimized job postings, a "spacer" function and marker clusters for maps. OpenCms 17 has also been tested and certified using Java 17 LTS and 21 LTS.
    Size:240154KB

    Click here to download

Upgrade OpenCms

  • Update your existing OpenCms installation to the current stable version 17 with the easy to use upgrade wizard.
    Size:196627KB

    Click here to download

Take the guided tour

Try the OpenCms Live Demo