Download the PHP package kreativsoehne/cookieconsent without Composer

On this page you can find all versions of the php package kreativsoehne/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 cookieconsent

Kreativsoehne - Cookieconsent

Cookie optin with brainsum/cookieconsent as the overlay and ways to block cookies and external resources.

Note: Version 3 has significant breaking changes and is not compatible with older version. However, if you find bugs or issues within v2 kindly open a issue with us and we'll see about updating v2 if necessary.

Install

Install through contao-manager or with composer require kreativsoehne/cookieconsent.

Run a database update.

Usage

Several of the basic settings will be available through the root page. In addition it adds a new Backend module allowing you to edit categories and services/cookies as you require.

Cookieconsent Customization

See cookieconsent documentation for further information into specific settings.

Default categories & services

You can download a database dump here which contains a list of categories and cookies/services which we found to be common enough and GDPR compliant (so far). It contains only english and german translations for the most part, but we'll update them with new languages as we get them (if you'd like to help, kindly open a issue or pull request and we'll update the database dump with your translations). There are also separate dumps for the rootpage configuration, one for each languages: English and German, which contain the basic texts for the cookieconsent layer itself.

You can import these through phpmyadmin and similar. Note: Use at your own discretion. Do not import anything into a Live system without testing first!

Languages

Through the template file cookieconsent_language several of the frontend languages settings can be customized or additional ones added as required. The format is a basic javascript object.

Opening the settings layer

If you require a link/button to open the cookie settings (2nd layer), you can use the content element "Cookieconsent Toggle".

It is also possible to manually render its template:

The options are:

Name Description Default
iconClass Optional list of icon classes (ie. Fontawesome).
Leave empty to not render an icon.
fa fa-cookie-bite
label The label of the button $GLOBALS['TL_LANG']['MCS']['cookieconsent_togglebutton_label']

Categories

Within the Backend module Category you can edit the list of categories within the 2nd layer. By default you should have at least these three categories, depending on the services you use:

Their aliases are used to enable or disable specific features later on.

Services

Within the Backend module Services/Cookies you can edit the list of services or single cookies within each category.

Types

Each service may have a specific type. Based on the type, the cookieconsent tool will try to block the service (or its cookies) if their superordinate category was not allowed by the user.

Name Description
Dynamic script These are javascript which will be added dynamically from within some other javascript (ie. google analytics)
Local Cookie These are cookies set by your own domain, either through the site request or javascript (ie. PHPSESSID)
Script-Tag These are javascript which are written as script tags within your site (ie. custom theme javascript files)

Note: The automatic blocking through any of these may not always work, as it greatly depends on the services or cookies and how these are set. Therefore below are several way to force block services and or cookies manually:

Blocking analytics

This is for Contao 4.9 and above. If you wish to block analytics and similar. Extend the template analytics_google.html5 and replace this line:

This way the analytics and any other code there won't be rendered unless the analytics category was accepted by the user beforehand.

For Contao 4.4

Unfortunately Contao 4.4 has a different caching scheme in comparison to 4.9 and the above if-condition won't work in 4.4 (and perhaps any other versions below 4.9). Instead the condition has to be checked within the Javascript code, therefore the template analytics_google.html5 needs to look like:

Blocking Youtube & Vimeo

The content elements for Youtube and Vimeo will be blocked automatically if the user did not accept cookies for measurement usage. You can edit the block message through the template cookieconsent_blocknotice.html5 and its text through the TL_LANG variables.

Blocking anything else

If you require anything else to be blocked then these if-condition should help. In these examples we check if Analytics services/cookies were accepted by user:

In PHP:

In templates (Note: This will only work in 4.9 and above):

In Javascript:

Copyright

Copyright 2021 Kreativ&Söhne GmbH (https://www.kreativundsoehne.de)

See LICENSE for more information. See here for licensing information of brainsum/cookieconsent.


All versions of cookieconsent with dependencies

PHP Build Version
Package Version
Requires php Version ^7 || ^8
contao/core-bundle Version ~4.4 || ~4.9 || ~4.13
terminal42/dcawizard Version 2.*
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 kreativsoehne/cookieconsent contains the following files

Loading the files please wait ....