mgGetImages where condition for extra field

Hi Mark,
I’ve added custom extra field to moregallery.custom_fields

{
"class":{
    "label":"Album",
    "type":"select",
    "options":[{
        "value":"",
        "label":"empty"
    },{
        "value":"album1",
        "label":"album1"
    }]
}

}

What proper where condition should be?

 [[!mgGetImages?
                  &imageTpl=`page_photos_item_new_new`
                  &where=`{"class":"album1"}`
              
              ]]

This doesn’t work.

Thanks in advance,
Anton

It’s not currently possible to filter on the custom fields through the &where property.

What you can do is add a condition in your imageTpl; wrapping the entire output with a condition on the custom field:

[[+custom.class:eq=`album1`:then=`
   ... your html ...
`:else=``]]

I see, thanks for clarification.
Is there any other filtration method?
Now we have the whole list of images under resource content field…

There is a need to divide this set of images into variable number of sets (“albums”)…usually I do this via MIGX custom field…but MoreGallery is much more useful for client(and totally agree here). Is there any way how to add ModGallery inside MIGX or somehow add set of albums for particular resource?

Thx.

I’d typically use different gallery resources for different albums - is that not suitable in your use case?

Could also use the built-in tags and filter by that, but that’ll still show as one large gallery in your manager.

No.

1 Like

Thanks a lot, this suites well!