Forum

Thread tagged as: Gallery

perch Gallery and perch categories

Hi,

i want to have one gallery, and use perch categories to filter the images.

as I'll be using https://isotope.metafizzy.co/filtering.html

but perch_gallery_album_images() does not support categories.

is there a solution to this?

tony

Tony Monckton

Tony Monckton 0 points

  • 4 years ago
Duncan Revell

Duncan Revell 78 points
Registered Developer

As you 'only' require one gallery, do you have to use the Gallery app?

Put the image assets in a custom bucket, and use a multi-item region to display the gallery? Then you can use categories too.

cool, I see now.

many thanks

tony

Help!

my template works in perch cms. but the catSlug is not coming out on the page...

template

    <div class="grid-item all <perch:category id="catSlug" type="slug" />" >
        <a href="<perch:content id="galleryimage" type="image" class="space-bottom" label="Main Image" bucket="gallery" width="1024" height="1024" crop="true" />" class="gallery-item">
            <perch:content id="galleryimage" type="image" label="Article image" width="250" height="375" suppress="true" />
            <img src="<perch:content id="galleryimage" type="image" class="space-bottom" label="Main Image" bucket="gallery" width="250" height="375" />" alt="Gallery" >
            <span class="gallery-caption">
                <h3><perch:content id="galleryTitle" label="Title" type="text" /></h3>
                <p><perch:content id="galleryDesc" label="Description" type="text" /></p>
            </span>
        </a>
    </div>

    <perch:categories id="categories" set="gallery" label="Categories" display-as="checkboxes">
        <perch:category id="catTitle" type="hidden" suppress="true" />
    </perch:categories>

this line not outputting catSlug in the template <div class="grid-item all <perch:category id="catSlug" type="slug" />" >

what am i missing

Tony

fixed!


<div class="grid-item all <perch:categories id="categories" set="gallery" label="Categories" display-as="checkboxes"> <perch:category id="catSlug" type="slug" /> <perch:category id="catTitle" type="hidden" /> </perch:categories> >