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

[photos] Best practice to use lightbox #1056

Closed
sprnza opened this issue Aug 26, 2018 · 8 comments
Closed

[photos] Best practice to use lightbox #1056

sprnza opened this issue Aug 26, 2018 · 8 comments

Comments

@sprnza
Copy link

sprnza commented Aug 26, 2018

What is the best practice to use lightbox using this syntax ![]({lightbox}folder/file)?
The issue is in the README there is described a way to add Magnific Popup css and js files for templates that have a gallery or an image attached only and it obviously doesn't work for images added in the body of my text. Should I add the style and the javascript in every article or there is a way to find the {lightbox} syntax used on the page?

@antgel
Copy link

antgel commented Oct 6, 2018

A great question, to which I'd also like to know the answer. The documentation makes it seem like using {lightbox} automatically activates a lightbox, but in my pretty vanilla install, it just shows a thumbnail, which loads the photo when clicked on. I guess we are missing some JS and / or CSS in our themes, but at this point, it's not clear what is expected, let alone what is happening.

Edit: I just discovered https://github.com/kura/lightbox/, and added it to my PLUGINS. Now trying to see how it works with photos, nothing automagic happened. Not sure if you've already done this...

@scbash
Copy link

scbash commented Oct 6, 2018

I agree, it's far from a good out-of-the-box experience. There are some instructions in the Photo plugin README.md about modifying the Jinja templates, which is where I started by following their Magnific popup examples. But after that experience I ended up do a fairly significant overhaul to both the plugin and the templates to replace Magnific with PhotoSwipe.

@justinmayer
Copy link
Member

@wamonite: I believe you added the Lightbox feature to the Photos plugin via #824. Do you have any thoughts on the questions raised here?

@antgel
Copy link

antgel commented Nov 16, 2018

Update: I didn't use the Kura lightbox in the end, it required too much heavy lifting. I eventually understood how to integrate {lightbox} with https://lokeshdhakar.com/projects/lightbox2/, and you can see my very basic efforts at https://github.com/antgel/jewishfalmouth.org.

@justinmayer
Copy link
Member

I eventually understood how to integrate {lightbox} with https://lokeshdhakar.com/projects/lightbox2/

@antgel: Based on what you learned, would you be willing to make some edits/additions to the Photos plugin README to help clarify and elaborate?

@wamonite
Copy link
Contributor

Glad you got it working. The README probably should be more explicit that you need to include the JS and CSS for http://lokeshdhakar.com/projects/lightbox2/ yourself, as using {lightbox} only generates the img tag with attributes that the lightbox requires.

@phibos
Copy link
Contributor

phibos commented Aug 15, 2021

We have moved the plugin to its own repository(https://github.com/pelican-plugins/photos/) and I have created an issue(pelican-plugins/photos#1) there to track the process. Feel free to use the new issue to add comments. Contributions are welcome.

@justinmayer or @sprnza I think you can close this issue.

@justinmayer
Copy link
Member

Agreed — let's move this discussion to the aforementioned issue in the new independent repository.

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

6 participants