Closed Werbschaft closed 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.
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?
Yes that should do the trick.
Do you set the RewriteBase in you .htaccess
?
https://github.com/getkirby/plainkit/blob/master/.htaccess#L11-L18
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 😃
I just tested it in a clean kirby-subfolder installation and it worked out of the box. With and without the RewirteBase option in .htaccess
. I'm sorry that it doesn't work for you.
The language depends on your sites language configuration. Kirby is english by default.
With the last one you have a point. I will include the option to set the features in the snippet.
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
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 ...