PHPackages                             kunstmaan/cookie-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. kunstmaan/cookie-bundle

ActiveSymfony-bundle

kunstmaan/cookie-bundle
=======================

The Kunstmaan Cookie Bundle provides a cookie bar; detailed pop-up window and a similar page explaining each type of cookie used on the website.

7.3.0(1y ago)09.3k↓50%9MITPHPPHP ^8.1

Since May 29Pushed 3mo ago11 watchersCompare

[ Source](https://github.com/Kunstmaan/KunstmaanCookieBundle)[ Packagist](https://packagist.org/packages/kunstmaan/cookie-bundle)[ RSS](/packages/kunstmaan-cookie-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (5)Versions (93)Used By (0)

KunstmaanCookieBundle
=====================

[](#kunstmaancookiebundle)

The Kunstmaan Cookie Bundle provides a cookie bar; detailed pop-up window and a similar page explaining each type of cookie used on the website.

All provide the ability to accept or decline certain cookies.

Original Contributors
=====================

[](#original-contributors)

UsernameAvatar[@sandergo90](https://github.com/sandergo90)[![sandergo90](https://github.com/sandergo90.png?size=100)](https://github.com/sandergo90.png?size=100)[@diskwriter](https://github.com/diskwriter)[![diskwriter](https://github.com/diskwriter.png?size=100)](https://github.com/diskwriter.png?size=100)[@indrikenens](https://github.com/indrikenens)[![indrikenens](https://github.com/indrikenens.png?size=100)](https://github.com/indrikenens.png?size=100)[@FVKVN](https://github.com/FVKVN)[![FVKVN](https://github.com/FVKVN.png?size=100)](https://github.com/FVKVN.png?size=100)[@dbeerten](https://github.com/dbeerten)[![dbeerten](https://github.com/dbeerten.png?size=100)](https://github.com/dbeerten.png?size=100)[@treeleaf](https://github.com/treeleaf)[![treeleaf](https://github.com/treeleaf.png?size=100)](https://github.com/treeleaf.png?size=100)[@KMBenjaminSchodts](https://github.com/KMBenjaminSchodts)[![KMBenjaminSchodts](https://github.com/KMBenjaminSchodts.png?size=100)](https://github.com/KMBenjaminSchodts.png?size=100)[@sector32](https://github.com/sector32)[![treeleaf](https://github.com/sector32.png?size=100)](https://github.com/sector32.png?size=100)Enabling the bundle
===================

[](#enabling-the-bundle)

Add to Appkernel.php
--------------------

[](#add-to-appkernelphp)

Add to routing.yml
------------------

[](#add-to-routingyml)

```
KunstmaanCookieBundle:
    resource: "@KunstmaanCookieBundle/Resources/config/routing.yml"
    prefix:   /{_locale}/
    requirements:
      _locale: "%requiredlocales%"

```

Two ways to view the cookie implementation
------------------------------------------

[](#two-ways-to-view-the-cookie-implementation)

1: Login into the CMS

2: enable the cookie bundle under Settings -&gt; Cookie configuration

Importing the cookie bundle
===========================

[](#importing-the-cookie-bundle)

Show cookie on page
-------------------

[](#show-cookie-on-page)

Add following block to the main layout of your website

```
{# Kuma Cookie Bar #}
{% block kumacookiebar %}

{% endblock %}

```

CSS: First Method
-----------------

[](#css-first-method)

Apply all CSS by importing the legal.scss file into the vendors file of your project

```
@import "vendor/kunstmaan/cookie-bundle/src/Resources/ui/scss/legal";

```

CSS: Second method
------------------

[](#css-second-method)

Import the Kunstmaan Cookie Bundle variables and imports to be overridden. Copy the files at the following path to your project folder.

vendor/kunstmaan/cookie-bundle/Resources/ui/scss/config/\_variables.scss vender/kunstmaan/cookie-bundle/Resources/ui/scss/config/\_legal-imports.scss

Alter variables and comment imports to fit the project's styling.

Javascript
----------

[](#javascript)

### Via ES Module pattern

[](#via-es-module-pattern)

```
import '../../../../../../vendor/kunstmaan/cookie-bundle/bin/';

```

### Via buildtool

[](#via-buildtool)

You can include the compiled version in your buildtool - or directly in a template - via the following URL:

```
vendor/kunstmaan/cookie-bundle/src/Resources/ui/bin/index.js

```

### Global methods

[](#global-methods)

The CookieBundle exposes some utility methods that you can include in your project.

```
import {getKmccCookies} from '/kunstmaan/cookie-bundle/bin/'; // Returns the settings of all the cookies.
import {hasAllowedDatalayers} from '/kunstmaan/cookie-bundle/bin/'; // Shorthand to check if you're allowed to use dataLayers in this
 project.
import {asyncDomInitiator} from '
