SOW : Core Plugins

SOW = Step Of Web (Smarty author).
SOW plugins are part of Smarty Core, written from scratch!

SOW : GDPR

Simple GDPR Accept Cookies!
Able to extend the consent level - see below!
Reload this page to see the example.


/* 
	:: Plugin File
	src/js/sow.gdpr.js

	:: Plugin Init
*/	$.SOW.core.gdpr.init('#gdpr');


/* 
	:: Plugin Options|Defaults

*/	$.SOW.core.gdpr.init('#gdpr', {
		cookie_name: '__gdpr',
		cookie_expire: 365
	});
									

Basic Usage


<!-- 
	Reset GDPR:
		$.SOW.core.gdpr.destroy();
		OR BY HASH: #del:gdpr

	By hitting 'Accept & Continue' Button, default cookie is set to 0 (all cookies accepted).

	++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

	Extending Consent by level (examples):
			0 = accept all cookies!
			1 = website only
			2 = website + advertising
			... more if needed

		JS USAGE EXAMPLE:
			$.SOW.core.gdpr.extend(2); 	// allow website + advertising

		HTML EXAMPLE
			<a href="#" class="btn-cookie-extend" data-cookie-level="2">Website + Advertising</a>

		BACKEND:
			Backend should use '__gdpr' cookie.


	The following code should be present on all pages:
-->
<div id="gdpr" class="hide bg-white rounded-lg shadow-lg w-100 max-w-350 p--30 m--15 position-fixed fixed-bottom right-0 z-index-9999">
	
	<h3 class="fs--18 mb-4">
		
		<a href="#" class="close mt--n3">
			<span class="fi fi-close fs--18" aria-hidden="true"></span>
		</a>

		Smarty Cookies

	</h3>

	<hr>

	<p class="lead">
		We use cookies to improve your experience on our site and to show you personalised ads.
	</p>

	<a href="#" class="btn btn-primary btn-cookie-accept btn-lg btn-block">
		Accept &amp; Continue
	</a>
	
	<hr class="mt-4 mb-4">
	
	<p class="m-0">

		<span class="d-block">Need to learn more?</span>

		<a href="#" class="link-muted">Privacy Policy</a> 
		
		&ndash; and &ndash; 
		
		<a href="#" class="link-muted">Cookie Policy</a>

	</p>
</div>
									

Smarty Cookies


We use cookies to improve your experience on our site and to show you personalised ads.

Accept & Continue

Need to learn more? Privacy Policy – and – Cookie Policy