This plugin is free but if you use it in a commercial project please consider to
- unzip master.zip as
folder
site/plugins/kirby3-cookie-banner
or git submodule add https://github.com/michnhokn/kirby3-cookie-banner.git site/plugins/kirby3-cookie-banner
orcomposer require michnhokn/kirby3-cookie-banner
- Add a custom cookie consent modal
- Fully translatable.
- Intercept cookie status
- PHP functions to check for allowed features
For more features check out the wiki.
- Put the
cookie-modal
snippet right before the closing body tag.<?php snippet('cookie-modal', [ 'assets' => true, 'showOnFirst' => true, 'features' => [...], ]) ?>
- Set up your features for the cookie modal.
return [ 'michnhokn.cookie-banner' => [ 'features' => [ 'analytics' => 'Analytics', 'mapbox' => 'Mapbox' ] ] ];
- Listen for the
cookied:saved
event and receive anarray
of allowed features.u('body').on('cookies:saved', event => { console.log('Saved cookie features:', event.detail); })
Learn more in the wiki.
See all available functions in the wiki.
Roadmap: Have a look at this project.
License: MIT
Credits: MichnHokn