Skip to content
Grav 2.0 is officially stable. Read the announcement →
Archive

Administration of a gallery

Started by Muut Archive 10 years ago · 7 replies · 829 views
10 years ago

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?

10 years ago

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.

10 years ago

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.

10 years ago

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?

10 years ago

All right. Thanks guys! :) I'll check this out during the weekend.

10 years ago

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.

10 years ago

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

YAML
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:

HTML
<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

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1359 9 years ago
Archive · by Muut Archive, 9 years ago
2 936 9 years ago
Archive · by Muut Archive, 9 years ago
2 4066 9 years ago
Archive · by Muut Archive, 9 years ago
1 2955 9 years ago
Archive · by Muut Archive, 9 years ago
3 1121 9 years ago