Skip to content

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).

SimonWpt/addhash

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commits
 
 
 
 

Repository files navigation

CouchCMS Add Hash

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).

Installation

  1. Download Add-On
  2. Extract directory addhash 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/addhash/addhash.php' );

Usage

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">

Parameter

  • 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>">

About

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).

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages