zephir / kirby-cookieconsent

Cookieconsent plugin for Kirby 3
MIT License
43 stars 2 forks source link

Install problems #1

Closed dustsucker closed 11 months ago

dustsucker commented 1 year ago

Hello, I wanted to use your plugin with my Kirby site, but I ran into some issues. I installed the plugin via git submodules because it's easier for the deployment process in this case. And I put the snippets in the head element and the JS in my footer, so it's loaded last. It seems to not load the plugin. Error logs from Browser:

Loading failed for the <script> with source “http://localhost:8000/media/plugins/zephir/cookieconsent/index.js”. en:2037:81
Uncaught ReferenceError: initCookieConsent is not defined
    <anonymous> http://localhost:8000/en/cookieconsent.js:2
[cookieconsent.js:2:22](http://localhost:8000/en/cookieconsent.js)
    <anonymous> http://localhost:8000/en/cookieconsent.js:2

I tried adding the cookie consent https://github.com/orestbida/cookieconsent/tree/v2.9.2 dist folder into /media/plugins/zephir/cookieconsent/ and renaming the respectively to index.css and index.js, so they should be in the right spot if I understand the structure correctly. I don't know what to do next, why didn't it load the JS and CSS itself, or why isn't it suggested in the documentation where to put the files? Thanks for the great Work!

dustsucker commented 1 year ago

Okay, so with the CDN option it works, but it seems like the media folder does not work properly.

TheMaaarc commented 1 year ago

Hi @dustsucker

We use composer to install plugins and haven't encountered this problem yet. I'll test the submodule/manual installation today/tomorrow and push a fix. You shouldn't have to add the cookieconsent files manually, the plugin should provide those files for you.

As you said, you can use the CDN option instead of self-hosting for now.

TheMaaarc commented 1 year ago

I've tested the plugin using the manual/submodule installation, it works fine for me, it shouldn't be a problem for you either.

Can you check that the plugin folder is created correctly in your media folder?
It should look like this: image

Do you have another plugin that adds its own assets?

wdebusschere commented 4 months ago

deleting the media folder also fixes this..