Images don't show up in UniteGallery page

I am quite new with Grav. I have set up a blog page which contains a unitgallery container. The container appears, but the images are not shown. so probably the script can’t find the images. The documentation of the gallery shows where to place the images for a modular page, but not for a non-modular page… How should I do it???

You can set up a modular page and inject its content into a regular page:

{{ page.find('/_my_modular_page').content() }}

Thank you for your answer!
should I do that in the markdown file (item.md) or in a template file?
And where would I place the modular page?

Sorry, I am a complete newbe

Place this line in the page’s content, there where the gallery should appear.
Just save the modular page under some name and replace /_my_modular_page with that name. Preserve the trailing slash and underscore when doing this.

Probably I am still doing something wrong, but the images do not appear. I do have a container field and a loading gif…but nothing happens…

Folder structure:

04.articles

  • 03.sneeuw
    • Pictures
    • Item.md
    • modular.md

In modular.md I have:

title: gallery
content:
items: @self.modular

In item.md I have:

title: Sneeuw!
body_classes: ‘no-hero onderwerpen gallery blog’
assets_in_meta: true
unitegallery:
gallery_theme: tiles

In blog-item.html.twig I have

{{ unite_gallery(page.media.images, '{"gallery_theme":"' ~ page.header.unitegallery.gallery_theme ~ '"}') }}
{{ page.content|raw }} {{ page.find('/_gallery').content() }}
...

Does this modular page exist ?

I assume your modular page is modular.md.

So this should be
{{ page.find('/_modular').content() }}

Nope, doesn’t work… :frowning:

Then it might be a problem with the gallery plugin itself. Maybe some UniteGallery-experienced user can help out here?

Ok, Thanks Harald, so far.
BTW, I can always do it without plugin and use the original scripts and styles…

@TonHaarmans, Following the README of the plugin:

  • Installed plugin: $ bin/gpm install unitegallery
  • Added config to header of page ‘/pages/01.home/default.md’
    ---
    title: Home
    body_classes: title-center title-h1h2
    unitegallery:
      gallery_theme: tiles
    ---
    
  • Added the Twig snippet to ‘/user/themes/quark/templates/default.html.twig’:
    {% extends 'partials/base.html.twig' %}
    
    {% block content %}
      <div class="gallery-container {{ page.header.class }}">
          {{ unite_gallery(page.media.images, '{"gallery_theme":"' ~ page.header.unitegallery.gallery_theme ~ '"}') }}
      </div>
    
      {{ page.content|raw }}
    {% endblock %}
    
  • Added images to folder '/pages/01.home`
  • Launched browser:
    image

Notes:

  • Don’t paste Twig snippet into Quark templates, but use an inherited theme, else you will loose all changes when updating Quark…
  • You probably want to create a specific page template for the gallery. E,g ‘/user/themes/mytheme/templates/gallery.html.twig’ and paste Twig snippet in there.
    Then create a new page named ‘gallery.md’.
  • My config:
    • Clean Grav installation: v1.7.0-rc.3.
    • Theme Quark

Hope this helps…

Thanks! that did it!