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.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package kirby-cookieconsent

Kirby Cookieconsent plugin

A plugin to implement cookieconsent in Kirby.

Table of Contents

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

Option Type Default Description
root string "document.body" Root (parent) element where the modal will be appended as a last child.
autoShow boolean true Automatically show the consent modal if consent is not valid.
revision integer 1 Manages consent revisions; useful if you'd like to ask your users again for consent after a change in your cookie/privacy policy.
autoClearCookies boolean true Clears cookies when user rejects a specific category. It requires a valid autoClear array.
hideFromBots boolean true Stops the plugin's execution when a bot/crawler is detected, to prevent them from indexing the modal's content.
disablePageInteraction boolean true Creates a dark overlay and blocks the page scroll until consent is expressed.
lazyHtmlGeneration boolean true Delays the generation of the modal's markup until they're about to become visible, to improve the TTI score. You can detect when a modal is ready/created via the onModalReady callback.
guiOptions array see below You can extensively customize both the color scheme and the layout, based on your needs.
categories array see below Use to define your cookie categories.
translations array see below An array of translations for each language.
language array see below Defines the language and direction for single language installations.
cdn boolean false Whether to load the cookieconsent assets from jsdelivr.net or use the compiled assets provided with this plugin.

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. The translations essentialy control which categories exist.

To enable/disable categories you can use the categories option of the plugin. Be aware that disabling a category also requires you to update the translation files.

An empty array defines the category with the default options. You can pass additional options like enabled or readOnly in the array. Learn more about those options in the CookieConsent Documentation.

3.4 Disabling a category

To disable a category you have to remove it from the translations file. Follow "Overriding specific translations" to change the translations.

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.

  1. Create a new folder in your project. For this example we call it cc-translations.
  2. In that folder, create a new file en.php.

  3. Now you need to require (or include) this file in config.php. Because we want to see the new category custom-scripts we also need to update the categories option.

You can also override the whole translation file by coying the default file and adjusting the values. If you disable a category in the categories option you will need to override the sections part of the translations to exclude that category. 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

Credits


All versions of kirby-cookieconsent with dependencies

PHP Build Version
Package Version
Requires getkirby/composer-installer Version ^1.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package zephir/kirby-cookieconsent contains the following files

Loading the files please wait ....