Download the PHP package femundfilou/kirby-cookie-consent without Composer

On this page you can find all versions of the php package femundfilou/kirby-cookie-consent. 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-cookie-consent

Cookie Consent

Cookie Consent is a customizable, easy-to-use Kirby CMS plugin that manages cookie consents.

Concept

Categories

Cookie Consent uses categories to group single policies (or cookies as you wish). Each category is an object with the following entries.

key type value
id string unique string
label string Label visible to the user
description string Description visible to the user

Policies

A policy needs to be created for each cookie or tool you wish to have user consent for. A policy in an object with the following entries.

key type value
id string unique string
label string Label visible to the user
description string Description visible to the user
category string must match with an category id

Installation

Via composer

Usage

  1. Add the section to your site.yml to get an interface to provide policies and categories.

  2. Add this snippet to the footer of your website.

Handling consent

You need the handle the initialisation of your scripts and tools after consent of a user yourself. For this, you can use the CookieConsent.getUserConsent() function to return the policy ids, the user has given consent to. After given consent, the site will reload.

Example

Javascript Methods

A global object is added to window. You can use it by calling CookieConsent or window.CookieConsent. The object exposes the following entries.

key type description
policies array Return all possible policy ids
getUserConsent function Returns an array of policy ids, the user has consented to
openSettings function Opens the settings page.

Configuration

You can override the default configuration in your site/config/config.php or on the snippet itself. The following options are provided:

name type default possible values description
locale string 'en' 'en', 'de' Language used in the cookie banner. You can also add your own translation
expires number 365 any integer Number in days, the cookie banner shows up again.
position string 'bottom-right' 'center', 'bottom-right' Position of banner.
blockPage boolean false true, false Adds a layer to block interaction with the page.
autoIncludeJs boolean true true, false Automatically add necessary javascript assets.

Overwrite in config.php

Overwrite on snippet

Overwriting or adding translations

Out of the box this plugin provides support for German and English translations. You may overwrite them or add other languages. Look at the kirby docs for more info about how to add custom language variables.

The following variables are provided:

Styling

Cookie Consent uses CSS Variables. You can overwrite them in your styles.

Example overwrite in css

Example overwrite in scss

Be sure to use #{$sassVariable} to use scss variables in css variables.


All versions of kirby-cookie-consent with dependencies

PHP Build Version
Package Version
Requires getkirby/composer-installer Version ^1.2
getkirby/cms Version ^3.6 || ^4.0
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 femundfilou/kirby-cookie-consent contains the following files

Loading the files please wait ....