Forum

Thread tagged as: Gallery

Gallery category filter

Hi,

I'm having an issue working out how to display a gallery post filtered by its category. I have tried so many different ways bit I can't get anything g to work.

Thanks for any help

<?php perch_gallery_albums(array(
   'filter'=>'category',
   'image'=>true,
   'match'=>'eq',
   'value'=>'architectural-services',
   'template' => 'first-pro.html',
   'count' => '1'
));?>
Stephen Wild

Stephen Wild 3 points

  • 4 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

What result do you get? Does your category field have an ID of category ?

With that particular combination it shows is nothing...

In album.html

<perch:categories id="cegories" set="projects" label="Categories" display-as="checkboxes">

In the admin I've added a new Category list: Title = Projects Slug = projects

Then I added some Categories to the list... The Categories show on the admin album listing.

I'm trying to make a refinement style page where it only shows galleries in a specific category, but I'm really scratching my head with this issue.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Your ID is cegories which isn't the same as category.

Gallery is one of the older apps and doesn't support the central categories app yet. You can add categories to it as an additional field and filter on them.

oooppps...I've changed that error

album.html

<perch:categories id="categories" set="projects" label="Categories" display-as="checkboxes">

I've tried anything I can think of for hours and hours, but I still can't filter a gallery by its selected categories.

My Category sets = Projects One of the used categories in the gallery = Architectural Services

I don't know if any of this information can help someone help me, but I'm completely stuck.

Thanks

Rachel Andrew

Rachel Andrew 394 points
Perch Support

As Drew mentioned:

"Gallery is one of the older apps and doesn't support the central categories app yet. You can add categories to it as an additional field and filter on them."

So what you are trying to do isn't going to work.