Display Cookie Warnings on Silverstripe projects
- SilverStripe 3.1.*
composer require "bueckl/silverstripe-cookie-warning": "*"
- Download and copy module in SilverStripe root directory: https://github.com/bueckl/cookie-warning/
- Add to your Page.php:
public static function CookieWarningShown() { $shown = Cookie::get("CookieWarningShown"); if(!$shown) { Cookie::set("CookieWarningShown", true); return false; } return true; }
- Link css archive:
'cookie-warning/css/CookieWarning.css'
- Add to template:
<% include CookieWarning %>