I have made some progress on a new example plugin that satisfies your requirements. Before I upload the solution for your to try I would like to clarify a few details about the shortcodes you posted.
You have two [mla_term_list]
shortcodes to help the user select terms to filter the gallery by. Your “filter 1” is a checklist, which lets the user check one or more boxes to select the term(s) they want. The second, “filter 2”, is a dropdown control that lets the user pick one additional term. Both of these shortcodes use the attachment_category
taxonomy and display child terms under different parents.
I noticed that you added a use_filters=true
parameter to your “filter 2” shortcode. Are you using the “MLA UI Elements Example” plugin that handles this parameter? If so, is there a reason you don’t use the same parameter in your “filter 1” shortcode? The “MLA UI Elements Example” plugin provides a number of features such as making the term selections “stick” when the form is submitted and the page is refreshed.
I don’t have access to your site so I can’t see what terms you are using or guess at what they mean. For my experiments I assigned one of the child terms under each parent to some of the items in my library. I noticed that whenever I checked two or more of the boxes in the checklist I always get an empty gallery. Is that what you intend?
The query composed by your current shortcodes means “display the items that are assigned to ALL the boxes checked in filter 1 AND the term selected in filter 2″. An alternative would be “display the items that are assigned to ANY ONE OR MORE of the boxes checked in filter 1 AND the term selected in filter 2″. Does the second alternative make sense in your application? If so, I can help you adjust the shortcodes to make that change.
I also noticed that the two [mla_gallery]
shortcodes (one for pagination and one for display) have somewhat different data selection parameters. This will prevent the pagination controls from working correctly. Here are the corrected shortcodes I am using for my experiments:
[mla_gallery]
attachment_category="{+template:({+request:tax_input.attachment_category+}|no-term-selected)+}"
tax_operator=and
tax_include_children=false
post_mime_type=all
posts_per_page=20
mla_output="paginate_links,prev_next"
[/mla_gallery]
[mla_gallery]
attachment_category="{+template:({+request:tax_input.attachment_category+}|no-term-selected)+}"
tax_operator=and
tax_include_children=false
post_mime_type=all
posts_per_page=20
mla_caption="{+title+}"
link=file
mla_target="_blank"
mla_nolink_text="nothing found, make a selection"
size=medium
[/mla_gallery]
You can see I have added the tax_operator
, tax_include_children
and ‘post_mime_type` parameters to the pagination shortcode. The data selection parameters must be identical to keep the two shortcodes in synch.
If you can let me know whether you are using the “MLA UI Elements Example” plugin and which of the two alternative queries you intend I can complete my work on the new “exclude client items unless logged in” example plugin. Thanks for any additional information you can provide.