Administration of a gallery

I’m currently working with the photographer theme.

Is there a better way to handle the gallery configuration?
Any image uploaded is not listed due to the fact that we have of course to include it in the header configuration. But I want to be able to administer the images only through the admin plugin without directly editing the header.

How to approach this problem?

Consider the Gallery Recipe as an alternative approach, it reads all images in a subfolder to the page and their associated meta-files. It should not take too much configuration to allow for the generation of these meta-files along with file-uploads.

Gallery theme was probably written to match quite closely the theme/design it was ported from. It could probably be improved utilizing page media files + media metadata rather than just manually adding stuff to the header. This is pretty easily done by modifying the twig template that renders it.

If I understand you right, it should be possible to have several subfolders with several images inside, read and display them and use the foldernames to create filters similar to the gallery in photographer?

That’s very doable :slight_smile:

All right. Thanks guys! :slight_smile: I’ll check this out during the weekend.

Actually, I am working on a very similar setup which pulls the images from page-specific galleries (set in subfolders or through page-headers) into a main gallery which allows filtering by taxonomy and headers. Be interested to see your results and experience.

I solved this now.
In the site.yaml I have the following section:

galleries:
  - name: Winterg&aumlrten
    url: "/gallery-wintergaerten"
  - name: Holz-Terrassend&aumlcher
    url: "/gallery-holz-terrassendaecher"
  - name: Alu-Terrassend&aumlcher
    url: "/gallery-alu-terrassendaecher"
  - name: Wind- und Sichtschutz
    url: "/gallery-wind-sichtschutz"
  - name: Pergolen
    url: "/gallery-pergolen"
  - name: Vord&aumlcher
    url: "/gallery-vordaecher"
  - name: Carports
    url: "/gallery-carports"
  - name: Markisen
    url: "/gallery-markiesen"

while each gallery site uses a slightly modified template building the gallery menu and the images like this:

<div class="row">
                    <div class="col-lg-12 col-md-12 col-sm-12">

						<div id="options" class="clearfix">
                            <ul id="filters" class="pagination option-set clearfix" data-option-key="filter">

								<!--    <li><a href="/gallery" data-option-value="*" class="selected">Show all</a></li>   -->
								<!--  nickbe: Wird nicht benoetigt, da jede gallery jeweils eine eigene Seite ist -->
								<!--  nickbe: Das Menue wird jetzt aus der site.yaml gelesen -->

                                {% for item in site.galleries %}
                                    <li><a href="{{ item.url }}" data-option-value=".{{ item.name }}">{{ item.name }}</a></li>
                                {% endfor %}
                            </ul>
                        </div>

                        <div class="containerExtra">
                            <div id="container" class="clearfix">
								{% for image in page.media.images|sort %}
                                    <div class="element transition {{ element.filter }}" data-category="transition">
                                        <!-- <a href="{{ image.url }}" class="thumb"><figure class="img-polaroid">{{ image.resize(270, 190).contrast(site.imageeffect.contrast).colorize(site.imagetint.red,s ite.imagetint.green,site.imagetint.blue).html() }}</figure></a><span class="description">{{ image.filename|lower }}</span>    -->
										<a href="{{ image.url }}" class="thumb"><figure class="img-polaroid">{{ image.resize(270, 190).contrast(site.imageeffect.contrast).colorize(site.imagetint.red,s ite.imagetint.green,site.imagetint.blue).html() }}</figure></a><span class="description"></span>
                                    </div>
                                {% endfor %}
                            </div>

                        </div>
                    </div>
                </div>

This works perfectly for me.
Cheers

1 Like