Skip to content

restruct/silverstripe-cookiebar

Repository files navigation

Cookiebar Module

Overview

This module provides a configurable notice about cookies, a link to a page about them and an 'accept' link to close the notice. It's based on the cookiebar module by Aram Balakjian & Steve Heyes, adapted to be cache-able.

Screenshot 2022-07-02 at 14 13 29

Requirements

  • SilverStripe 4 or newer

Installation

Unpack and copy the cookiebar folder into your SilverStripe project (You can call the folder whatever you like).

Now add $CookieBar just before the closing body tag

...

	$CookieBar
</body>

...

Run "dev/build" in your browser, for example: "http://www.mysite.com/dev/build?flush=all"

Layout

The included template uses bootstrap for its layout. In case the site theme does not use bootstrap, there's an optional 'sans-bs' CSS file to include which provides a fallback layout:

Requirements::css('restruct/silverstripe-cookiebar:client/dist/css/cookiebar-layout-sans-bs.css');

Fallback layout (without bootstrap): Screenshot 2022-07-02 at 14 07 06