Skip to content

philipmarnef/kirby3-cookie-banner

 
 

Repository files navigation

A Cookie Consent Modal for Kirby3

Release Last Commit

kirby3-cookie-banner

Commercial Usage

This plugin is free but if you use it in a commercial project please consider to

Installation

  • 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 or
  • composer require michnhokn/kirby3-cookie-banner

Features

For more features check out the wiki.

Setup

  1. Put the cookie-modal snippet right before the closing body tag.
    <?php snippet('cookie-modal', [
        'assets' => true,
        'showOnFirst' => true,
        'features' => [...],
    ]) ?>
  2. Set up your features for the cookie modal.
    return [
        'michnhokn.cookie-banner' => [
            'features' => [
                'analytics' => 'Analytics',
                'mapbox' => 'Mapbox'
            ]
        ]
    ];
  3. Listen for the cookied:saved event and receive an array of allowed features.
    u('body').on('cookies:saved', event => {
        console.log('Saved cookie features:', event.detail);
    })

Learn more in the wiki.

Methods

See all available functions in the wiki.

Misc

Roadmap: Have a look at this project.

License: MIT

Credits: MichnHokn

About

A Cookie Consent Modal for Kirby3

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 42.5%
  • JavaScript 36.0%
  • SCSS 21.5%