Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lightslider only works after reloading the page #44

Open
TristanKonrad opened this issue Mar 25, 2021 · 2 comments
Open

lightslider only works after reloading the page #44

TristanKonrad opened this issue Mar 25, 2021 · 2 comments

Comments

@TristanKonrad
Copy link

Hello,

I installed the lightslider plugin on my Grav page and I have to reload the page everytime for the lightslider to show up. I am fairly new to coding and took the page over from our coder who left the company.

Please tell me if you need additional information.

Kind regards
Tristan

@foersterp
Copy link

Hello,

I have the same problem. In Chromium (96.0.4664.45) I have to reload the page for the lightslider to show up. In Firefox (94.0) it shows up sometimes and sometimes it doesn't.

The Chromium console prints the following error:
chromium

And the Firefox console shows this error:
firefox

I'm new to coding and Grav so I don't know how to solve this problem. Maybe somebody knows.

But is the project actually under active development?

Thanks!

@foersterp
Copy link

I found a fix for that problem here: https://discourse.getgrav.org/t/how-to-install-a-slider-between-two-sections-of-an-existing-modular-page/18962

I edited /user/lightslider/templates/modular/lightslider.html.twig and added the code from the forum post which is the following:

<script type="text/javascript"> document.addEventListener("DOMContentLoaded", () => { --- insert original javascript here --- }); </script>

I don't know if this is the correct file to edit but it worked for me.

I hope that helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants