michnhokn / kirby-cookie-banner

A Cookie Consent Modal for Kirby
MIT License
67 stars 9 forks source link

Cookie not set #2

Closed Werbschaft closed 3 years ago

Werbschaft commented 3 years ago

Is this Plugin working on localhost? On each refresh I get the modal again, no matter what I click. Also there's no cookie set ...

michnhokn commented 3 years ago

How do you implement the plugin? Are all the required JavaScript assets included? Please provide code so i can help you a little bit better.

Werbschaft commented 3 years ago

Added this to the Footer, done! All assets are loaded, error console is empty ...

<?php snippet('cookie-modal', ['assets' => true]) ?>

So hard to give more informations. Maybe cause the installation is in a subfolder?

michnhokn commented 3 years ago

Yes that should do the trick. Do you set the RewriteBase in you .htaccess? https://github.com/getkirby/plainkit/blob/master/.htaccess#L11-L18

Werbschaft commented 3 years ago

Tested in the main folder and now belongs to. Is there no way to get it ready to use right out of the box in subfolders? What else I noticed while testing:

• why in English as standard? I think many instances are not multilingual • What would be great if you don't have to set the features in the options but directly in the snippet. Cause options can't be controlled in the panel. Example:

<?php snippet('cookie-modal', ['assets' => true, 'features' => 'analytics, youtube']) ?>

Or maybe also as another array. But only a suggestion 😃

michnhokn commented 3 years ago
Werbschaft commented 3 years ago

No problem that it doesn't work, after all you can live with that! Also that the languages ​​then have to be changed directly in the plugin, a simple swap from en to de is pretty quick.

It might be possible to use the features as a comma-separated list with $field->split($separator = ','): array then you could fill the snippet with the standard Kirby fields