BoxLang 🚀 A New JVM Dynamic Language Learn More...
Extension to add functionality for displaying a cookie consent notification to site visitors.
Install the extension to your application via either of the methods detailed below (Git submodule / CommandBox + ForgeBox)
From the root of your application, type the following command:
git submodule add https://github.com/nodoherty/preside-ext-cookie-consent.git application/extensions/preside-ext-cookie-consent
From the root of your application type the following command:
box install preside-ext-cookie-consent
From the Preside CMS developer console (using the back tick ` key) reload the application:
reload all
Once the files are installed, enable the extension by opening up the Preside CMS developer console and entering:
extension enable preside-ext-cookie-consent
reload all
Add the following line below the closing
tag in your layout templates.
...
#renderViewlet( event="CookieConsent._cookieConsent" )#
</body>
</html>
To make it easier to customise the look and feel you can find the CSS files under /assets/specific/cookie-consent/
The main changes should only be to the background colours, button colours and text colours etc. I'll leave that to you.
If you are a fan of CSS pre-processors then you can take advantage of the LESS CSS files and inherent grunt
task file for processing any changes.
The only changes required are to the global less files colours.less
and fonts.less
. Any changes to these files will result in the values being updates in the output CSS files.
From within the assets folder you can now install the node packages required to easily update the styles for all default stylesheets.
To do so you simply need to (from the terminal):
assets/
foldernpm install
which will download any dependencies defined in the package.json
fileTo apply the changes you have made to the .less
files you need to execute the task runner. To do so simply:
grunt
from within the assets/
folder which will execute the default taskThis will recompile any changes to the LESS variables / files and output the .css
and .min.css
version of each stylesheet required for the themes.
Note: By default the extension uses the minified versions of the CSS files.
Credit to the folk at SilkTide
https://silktide.com/tools/cookie-consent/
Code released under the MIT licence.
See SilkTide licence for details.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
[![ZenHub] (https://raw.githubusercontent.com/ZenHubIO/support/master/zenhub-badge.png)] (https://zenhub.io)
$
box install preside-ext-cookie-consent