Download the PHP package zephir/kirby-cookieconsent without Composer
On this page you can find all versions of the php package zephir/kirby-cookieconsent. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package kirby-cookieconsent
Kirby Cookieconsent plugin
A plugin to implement cookieconsent in Kirby.
- Uses the open source cookieconsent library
- Provides default translations for 5 cookie categories
- Multilingual support (EN/DE/FR)
- Customizable
Table of Contents
- Kirby Cookieconsent plugin
- Table of Contents
- 1. Installation
- 1.1 Composer
- 1.2 Download
- 1.3 Git submodule
- 2. Setup
- 3. Options
- 3.1 Available options
- 3.2 Defaults
- 3.3 Predefined cookie categories
- 3.4 Removing a category
- 4. Language
- 5. Translations
- 5.1 Overriding specific translations
- 6. Events
- License
- Credits
1. Installation
The recommended way of installing is by using Composer.
1.1 Composer
1.2 Download
Download and copy this repository to /site/plugins/kirby-cookieconsent
.
1.3 Git submodule
2. Setup
Add snippet('cookieconsentCss')
to your header and snippet('cookieconsentJs')
to your footer.
3. Options
3.1 Available options
3.2 Defaults
3.3 Predefined cookie categories
Each cookie category can be used to control certain scripts. To learn how to manage scripts, head over to the CookieConsent documentation.
Categories that are predefined by this plugin:
Name | Enabled | Description |
---|---|---|
necessary | ✅ | The necessary cookies, can't be disabled by the user. |
functionality | ✅ | Cookies for basic functionality and communication. |
experience | ✅ | Cookies to improve the quality of the user experience and enable the user to interact with external content, networks and platforms. |
measurement | ✅ | Cookies that help to measure traffic and analyze behavior. |
marketing | ✅ | These cookies help us to deliver personalized ads or marketing content to you, and to measure their performance. |
Predefined means that there are translations in all languages for each category.
To enable/disable categories you can use the categories
option of the plugin.
An empty array defines the category with the default options. You can pass additional options like
enabled
orreadOnly
in the array. Learn more about those options in the CookieConsent Documentation.
3.4 Removing a category
To remove a category you have to set its value to false
.
4. Language
If you have a single language setup (kirby option languages
not set to true
), you will have to define the language
option of the plugin.
For multi-language setups you don't have to do anything, the plugin automatically uses the kirby language or falls back to the first translation in the translations array.
5. Translations
The translations are a central part of the plugin. By default, we provide translations for EN, DE, FR and the categories mentioned in 3.3 Predefined cookie categories.
To customise or override the default translations, you will need to use the translations
option.
5.1 Overriding specific translations
For this example we are overriding one string and adding a new category in the sections part of the EN translation.
- Create a new folder in your project. For this example we call it
cc-translations
. -
In that folder, create a new file
en.php
. - Now you need to require (or include) this file in
config.php
. Because we want to see the new categorycustom-scripts
we also need to update thecategories
option.
You can override the whole translation file by copying the default file and adjusting the values. You can also require the default translation and manually alter the array by modifying, adding or deleting entries.
6. Events
You can find all available events in the CookieConsent Documentation.
The CookieConsent object is available through the window object (
window.CookieConsent
).
License
MIT