Download the PHP package michnhokn/kirby3-cookie-banner without Composer
On this page you can find all versions of the php package michnhokn/kirby3-cookie-banner. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download michnhokn/kirby3-cookie-banner
More information about michnhokn/kirby3-cookie-banner
Files in michnhokn/kirby3-cookie-banner
Package kirby3-cookie-banner
Short Description Add a cookie modal to your Kirby3 website
License MIT
Informations about the package kirby3-cookie-banner
Kirby Cookie Banner
Integrate a user-friendly cookie banner into your Kirby website with ease. This simple solution allows for effortless incorporation directly into your Kirby page.
Key Features
- 🚀 Customizable Cookie Consent Modal: Design the modal to perfectly match your website's look and feel.
- 🌐 Multilingual Support (including German & English): Deliver a seamless user experience by displaying the cookie banner in different languages.
- ⏱️ Real-time Cookie Consent Detection: Keep track of user preferences and adapt accordingly.
- ✅ Easy Feature Management with a Helper Class: Simplify checking for allowed cookies and features within your Kirby code.
- ✨ Effortless Style Integration: Apply your custom CSS styles with minimal hassle.
Installation
Composer
Download
Download and copy this repository to /site/plugins/kirby-cookie-banner
Usage
Configuration
The cookie banner includes a pre-configured "Essential Feature" with customizable text using language variables. You can
easily add more features by editing your /site/config/config.php
file. By default, leverage language variables for
feature values, but if you're not using Kirby's multi-language functionality, simply adjust the text directly in the
configuration.
Snippet
`
Track User Cookie Preferences
The cookie banner triggers a cookies:saved event on the
tag whenever a user confirms their settings. This allows you to easily capture this event and react accordingly. Here's an example of how you might intercept it:Open the cookie modal
Want to give users the option to revisit cookie settings? Simply add a link that calls the openCookieModal() method of the cookie banner. For instance, clicking this link would reopen the modal:
Helper class
The Michnhokn\CookieBanner
class offers a set of handy methods to control your cookie features.
This simplifies tasks like:
- Checking if a specific feature is allowed by the user.
- Performing actions based on allowed features.
Translate the modal
Customize your cookie banner for a global audience! Simply provide the following variables through a language file to translate the modal content. This ensures a seamless user experience in any language.
Support the project
[!NOTE] This plugin is provided free of charge & published under the permissive MIT License. If you use it in a commercial project, please consider to buy me a beer 🍺
Compatability
Starting with version 1.1.0
of this plugin, it is only compatible with Kirby 4.
If you need to install this plugin for a Kirby 3 instance, please use version 1.0.9
.
License
Michael Engel