Open akator70 opened 1 year ago
I am having the same issue. I run my grav site out of a subfolder, but the A HREF to show the image runs off the root.
i.e. Images are here: /cms/photos/gallery/image.png
Plugin is setting the HREF to: /photos/gallery/image.png
The gallery loads fine but viewing the image is just a continuous load.
I was able to fix this by changing line 29 in plugins/dir-gallery/shortcodes/DirGalleryShortcode.php and changing it from:
'slug' => "$image_route/$image_directory",
to:
'slug' => "/cms$image_route/$image_directory",
This adds /cms to the Url Path where my images actually exist from my previous example above.
It appears the code does not properly represent the install folder of grav in the url path. The Gallery grid is loaded by File Paths instead of URL Paths which is why it works and the display doesn't. This is a major oversight as most Grav tutorials have you load it into a subfolder like I am doing.
I had the same problem, apparently the addon only works when the GravCMS is installt in the root directory of a domain.
File: user/plugins/dir-gallery/templates/partials/dir-gallery.html.twig
Change in line 4 and 13: from: <a href="{{ slug }}/{{ image.filename }}" to: <a href="{{ base_url }}{{ slug }}{{ image.filename }}"
I will test if it works with the changes when the GraveCMS is installed in the root directory. If so, I will submit a change request.
@prikle
It's working for me, thanks!
Thanks for creating this plugin!
I've got the plugin installed and it displays a nice gallery, but none of the images load in lightbox after selecting them. Lightbox loads but there's just a spinning loading icon and no image appears.
Any suggestions?