Coded something up in Couch in an interesting way? Have a snippet or shortcode to share? Post it here for the community to benefit.
3 posts Page 1 of 1

I was missing a HTML minifier feature, so I used the tiny-html-minifier from
(2.78 KiB) Downloaded 62 times

  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)
    Code: Select all
    require_once( K_COUCH_DIR.'addons/tiny-html-minifier/TinyMinify.php' );
This addon makes available a new tag called minify. It is very simple to use:
Code: Select all
    <!-- here comes your HTML and CMS code :) -->
    <p>Compression works:</p>

Code will minified to:
Code: Select all
<p>Compression works:</p> <ul> <li> Really? </li> <li> Really! </li> </ul> 

You can set two additional parameter (collapse_whitespace and disable_comments) to true or false (default is false):
Code: Select all
<cms:minify collapse_whitespace="true" disable_comments="true"></cms:minify>


Hope, you like and need it ;)
Awesome, will test this out! Thank you! Happy friday ;)
Very nice, SimonWpt. I have syntax-amended base class so it works on >=PHP 5.3 (minimal CouchCMS requirement).
(2.52 KiB) Downloaded 3 times

Did you know that it is possible to auto-minify all HTML from both Admin Panel and Frontend automatically without using tags, using this addon and a couple of CouchCMS Events?
3 posts Page 1 of 1

Who is online

In total there are 3 users online :: 0 registered, 0 hidden and 3 guests
(based on users active over the past 5 minutes)

Users browsing this forum: No registered users and 3 guests