Thanks for your question and for taking the time to find the “search form example” and study it. Thanks as well for including the full text of your shortcode; very helpful. If your list of (four) Att. Categories terms is static, the “search form example” can be adapted to achieve your goal.
Here is an example I constructed on my test system:
<h3>Selection Form</h3>
Select one or more Attachment Categories, then click "GO":
<form id="attachment-category-form" method="post" action=".">
Single Select:
<select name="form_categories[]" class="postform">
<option selected="selected" value="">-- Select a value --</option>
<option value="california">California</option>
<option value="boden-canyon">Boden Canyon</option>
<option value="admin">Administration</option>
</select>
<br />Multiple Select:
<select multiple name="form_categories[]" class="postform">
<option value="california">california</option>
<option value="boden-canyon">Boden Canyon</option>
<option value="admin">Administration</option>
</select>
<br />Checkbox:
<input name="form_categories[]" id="check-california" type="checkbox" value="california">California
<input name="form_categories[]" id="search-name" type="checkbox" value="boden-canyon">Boden Canyon
<input name="form_categories[]" id="search-name" type="checkbox" value="admin">Administration
<br /><input type="submit" id="submit" name="submit" value="GO">
</form>
<h3>Direct Links</h3>
<ul>
<li><a href=".?form_categories[]=california">California</a></li>
<li><a href=".?form_categories[]=boden-canyon">Boden Canyon</a></li>
<li><a href=".?form_categories[]=admin">Administration</a></li>
</ul>
<h3>The Gallery</h3>
[mla_gallery post_parent=all post_mime_type=video mla_style="none" mla_markup="school-library" size=icon attachment_category="{+template:({+request:form_categories+}|a-bad-term)+}" mla_nolink_text="Select one or more terms to display the gallery."]
Of course, your attachment_category
terms will be different; adjust the value
attributes and the text labels accordingly.
In this example you can pick any combination of terms in the Selection Form’s Single Select, Multiple Select (hold down the Control key to select more than one value) and Checkbox controls. Click “GO” to submit the form. Click on any of the Direct Links for an immediate display. The form_categories[]
query argument passes the selection(s) from the form or link back to the same page for gallery display. In the [mla_gallery]
shortcode the attachment_category="{+template:({+request:form_categories+}|a-bad-term)+}"
parameter filters the gallery by the selected value(s). It contains a Content Template that uses the form_categories
when they are present or substitutes a-bad-term
to suppress the gallery display if they are not.
If the Att. Categories change and your application requires a dynamic list of terms a small custom plugin will be required. Let me know if that’s needed and I can be more specific.
Build a standard WordPress page around the above example and play with it. I will leave this topic unresolved until I hear back from you regarding your progress. Have fun!