Download the PHP package innoweb/silverstripe-cookie-consent without Composer

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

Silverstripe Cookie Consent

Version

Overview

Creates a cookie consent popup and cookie policy page.

While we try to tick as many legal boxes as we can, we give no warranty for this module to adhere to any legislation, including GDPR.

This is an amended and simplified version of TheBnl's cookie consent module. Thanks for your work and inspiration!

Requirements

Note: this version is compatible with Silverstripe 5. For Silverstripe 4, please see the 2 release line.

Installation

Install the module using composer:

Then run dev/build.

Include the popup template in your base Page.ss

Configuration

You can configure the cookies and cookie groups trough the yml config. You need to configure by provider, for providers the dots are converted to underscores e.g. ads.marketingcompany.com becomes ads_marketingcompany_com.

By configuring cookies trough yml you can check for consent in your code and make the necessary changes e.g. require the analytics or other cookies or skip placing them.

The texts for the configured cookies are editable trough the Site Config, here other cookies can also be added by CMS users. For example if a site user decides to embed a Youtube video he or she can specify the cookies that are placed by Youtube. I reccomend the following three groups to be created, these have default content, of course you are free to configure groups as you see fit.

This module comes with some default content for cookies we've encountered before. If you want to set default content for these cookies yourself that is possible trough the lang files. If you have cookie descriptions that are not in this module, contributions to the lang files are much appreciated!

The files are structured as such:

You can also configure the requirement of the default css styles.

Usage

Then you can check for consent in your PHP code by calling

In templates, you can check for consent using

The CookieConsent popup fires a custom JavaScript event updateCookieConsent when the acceptance buttons in the popup are clicked. You can use that event to conditionally load parts of your site depending on what cookies have been set.

JavaScript example

Here an example that lazy-loads a video embed only if marketing cookies have been accepted:

Template:

Script:

Default Pages

This module also sets up one default privacy policy page on running dev/build.

If you want to prevent that behaviour you should disable the create_default_pages config setting.

The page created is filled with bare-bones content. Of course, it is your or your CMS users responsibility to alter these texts to make them fit your use case!

License

BSD 3-Clause License, see License


All versions of silverstripe-cookie-consent with dependencies

PHP Build Version
Package Version
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 innoweb/silverstripe-cookie-consent contains the following files

Loading the files please wait ....