CouchCMS Addon. Adds a new <cms:addhash>
-Tag to add a timebased hash to a url. This forces the browser to reload a linked ressource (i.e. CSS oder Javascript).
- Download Add-On
- Extract directory
addhash
in'couch/addons'
folder. - Add the following entry in
'couch/addons/kfunctions.php'
file
(if this file is not found, rename thekfunctions.example.php
file tokfunctions.php
)
require_once( K_COUCH_DIR.'addons/addhash/addhash.php' );
This addon makes available a new <cms:addhash>
-Tag. It is very simple to use:
<link rel="stylesheet" href="<cms:addhash>/assets/css/main.min.css</cms:addhash>">
The generated code looks like:
<link rel="stylesheet" href="/assets/css/main.min.css?20220407120139">
- mode
Parameter can be set to filedate
or now
(default is filedate
):
filedate
generates the hash from the filedatetime.now
generates the hash from the actual datetime.
<link rel="stylesheet" href="<cms:addhash mode='now'>/assets/css/main.min.css</cms:addhash>">