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

viewer.js for gallery pages #4

Open
bwaklog opened this issue Jul 28, 2024 · 0 comments
Open

viewer.js for gallery pages #4

bwaklog opened this issue Jul 28, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@bwaklog
Copy link
Contributor

bwaklog commented Jul 28, 2024

We plan to use viewer.js for making the galleries more interactive for users. While the library is being called there are a lot of cases where this implementation fails

How this works is, static/scripts/viewer.js applies the script on all images inside a div with id #images which should look something like this

const gallery = new Viewer(document.getElementById("images"), {transition: false});
<div id="images">
    <img loading="lazy" src="url" alt="alt">
    <img loading="lazy" src="url" alt="alt">
</div>

The gallery page is organised in a different manner, where each event is placed under its own details tag to make them a drop down, so these images div are nested deep inside the page. There is also another issue with how and when this script is called. The gallery page is not hard coded but is filled in by a script called gallery.js which can be found in the static/scripts directory. This reads the urls from a json file at static/images/gallery/gallery.json and populates a section block with id gallery. So ensure that viewer.js which is being called in the head_gallery.html layout file is called after all the images are populated in the page

@bwaklog bwaklog added the bug Something isn't working label Jul 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant