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 16 brings the new app "Unused contents" that allows to find and delete content that is not actively used on any container page. It is now possible to select between several individual detail pages in the same website based on categories of the detail content. It can now be enforced that all content managers must set a new password after the next login. The default Mercury template brings several new features, e.g. the "Image tile display" formatter for the "Tabs / accordion" element.
    Size:236456KB

    Click here to download

Upgrade OpenCms

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

    Click here to download

Take the guided tour

Try the OpenCms Live Demo