Skip to content

Commit

Permalink
add 'showOnFirst' option to hide cookie modal on initial pageload
Browse files Browse the repository at this point in the history
  • Loading branch information
michnhokn committed Jan 19, 2021
1 parent 0cd40d4 commit 3a122fc
Show file tree
Hide file tree
Showing 6 changed files with 3,344 additions and 12 deletions.
23 changes: 18 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# A Cookie Consent Modal for Kirby3

![Release](https://flat.badgen.net/packagist/v/michnhokn/kirby3-cookie-banner?color=92a9c4)
![Last Commit](https://flat.badgen.net/github/last-commit/michnhokn/kirby3-cookie-banner?color=92c496)

Expand All @@ -7,26 +8,36 @@
## Commercial Usage

This plugin is free but if you use it in a commercial project please consider to

- [buy me a 🍺](https://buymeacoff.ee/michnhokn)

## Installation
- unzip [master.zip](https://github.com/michnhokn/kirby3-cookie-banner/archive/master.zip) as folder `site/plugins/kirby3-cookie-banner` or

- unzip [master.zip](https://github.com/michnhokn/kirby3-cookie-banner/archive/master.zip) as
folder `site/plugins/kirby3-cookie-banner` or
- `git submodule add https://github.com/michnhokn/kirby3-cookie-banner.git site/plugins/kirby3-cookie-banner` or
- `composer require michnhokn/kirby3-cookie-banner`

## Features

- Add a custom cookie consent modal
- Fully [translatable](https://github.com/michnhokn/kirby3-cookie-banner/wiki/02-Translate-the-modal).
- [Intercept](https://github.com/michnhokn/kirby3-cookie-banner/wiki/01-How-to-set-it-up#-intercept-changes-to-the-cookie-settings) cookie status
- [Intercept](https://github.com/michnhokn/kirby3-cookie-banner/wiki/01-How-to-set-it-up#-intercept-changes-to-the-cookie-settings)
cookie status
- [PHP functions](https://github.com/michnhokn/kirby3-cookie-banner/wiki/03-PHP-functions) to check for allowed features

For more features check out the [wiki](https://github.com/michnhokn/kirby3-cookie-banner/wiki).

## Setup

1. Put the `cookie-modal` snippet right before the closing body tag.
``` php
<?php snippet('cookie-modal', ['assets' => true]) ?>
```
```` php
<?php snippet('cookie-modal', [
'assets' => true,
'showOnFirst' => true,
'features' => [...],
]) ?>
````
2. Set up your features for the cookie modal.
````php
return [
Expand All @@ -48,9 +59,11 @@ For more features check out the [wiki](https://github.com/michnhokn/kirby3-cooki
Learn more in the [wiki](https://github.com/michnhokn/kirby3-cookie-banner/wiki/01-How-to-set-it-up).

## Methods

See all available functions in the [wiki](https://github.com/michnhokn/kirby3-cookie-banner/wiki/03-PHP-functions).

## Misc

**Roadmap**: Have a look at this [project](https://github.com/michnhokn/kirby3-cookie-banner/projects/1).

**License**: `MIT`
Expand Down
2 changes: 1 addition & 1 deletion assets/cookie-modal.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "michnhokn/kirby3-cookie-banner",
"description": "Add a cookie modal to your Kirby3 website",
"type": "kirby-plugin",
"version": "1.0.7",
"version": "1.0.8",
"license": "MIT",
"authors": [
{
Expand Down
Loading

0 comments on commit 3a122fc

Please sign in to comment.