Skip to content

Latest commit

 

History

History
52 lines (38 loc) · 1.12 KB

README.md

File metadata and controls

52 lines (38 loc) · 1.12 KB

CouchCMS HTML Minifer

CouchCMS Addon. Adds a new <cms:minify>-Tag to minify/compress the HTML Output.

Installation

  1. Download Add-On
  2. Extract directory tiny-html-minifier in 'couch/addons' folder.
  3. Add the following entry in 'couch/addons/kfunctions.php' file
    (if this file is not found, rename the kfunctions.example.php file to kfunctions.php)
require_once( K_COUCH_DIR.'addons/tiny-html-minifier/TinyMinify.php' );

Usage

This addon makes available a new <cms:minify>-Tag. It is very simple to use:

<cms:minify>
    <!-- here comes your HTML and CMS code :) -->
    <p>Compression works:</p>
    <ul>
        <li>
            Really?
        </li>
        <li>
            Really!
        </li>
    </ul>
</cms:minify>

Code will minified to:

<p>Compression works:</p> <ul> <li> Really? </li> <li> Really! </li> </ul> 

Parameter

  • collapse_whitespace
  • disable_comments

Both parameter are boolean and can set to true or false (default is false):

<cms:minify collapse_whitespace="true" disable_comments="true"></cms:minify>

Requirements

PHP7+