Thanks for your update. I am happy to hear my earlier suggestions were of some help. Thanks as well for taking the time to create and post links to the example pages for your application; very helpful.
You wrote “I wish if there could be an easier markup/css.” Are you using MLA’s custom style and markup templates? You can replace the default CSS styles and gallery HTML markup with anything you need for your application. If you want to explore that option, let me know how I can help.
Regarding your three questions:
Why do my users have to use two different searches for documents and page/posts? Can my documents be searched in site wide search?
This is an unfortunate consequence of WordPress history and evolution. The “attachment” post type was created very early in WordPress, long before custom post types were added in version 3.0. Part of my motivation for MLA was to make attachments work more like other, more modern post types. Sadly, there is quite a lot of PHP code scattered throughout the WordPress core that hard-wires features like site-wide search and taxonomy archive pages to exclude the “attachment” post type. I have never found a practical way to address this legacy code.
How do I track the analytics for these documents?(using Google Analytics)
I understand this to mean that you want to track each “click” on a document title in the table; is that right? If so, your question is similar to this earlier topic:
Force Download breaks Google event tracking.
In fact, different things happen when a visitor clicks on a Word document like your “job_aid_apple” Vs a PDF document like your “form_apple”. The Word document will be downloaded, but the PDF document will automatically open in the browser window. You can use the “force download” technique from the earlier topic if that’s what you want, but the Google Analytics issue applies either way.
I haven’t done too much with Google Analytics but I would like to learn more and help solve your problem. If you can tell me the answers to the three numbered questions in the earlier topic and tell me if you want PDFs to open in the browser or be downloaded I will investigate further.
How do I enable two dropped down lists for categories and tags and submit both values and filter the results?
I have copied the form from your site, made a small change and added an [mla_gallery]
shortcode to illustrate a possible solution for this application:
<form id="attachment-tag-form" action="#" method="get">
<select name="a_category" class="postform">
<option value="">— Select a Category —</option>
<option value="apple">Apple</option>
<option value="banana">Banana</option>
<option value="orange">Orange</option>
</select>
<br>
<select name="a_tag" class="postform">
<option value="">— Select a Tag —</option>
<option value="job-aid">Job Aid</option>
<option value="form">Form</option>
<option value="user-guide">User Guide</option>
<option value="communication">Communication</option>
</select>
<br>
<input name="submit" id="submit" type="submit" value="GO">
<br>
</form>
<h3>The Gallery</h3>
[mla_gallery orderby=date order=desc post_mime_type=all post_parent=all tax_relation=OR attachment_category="{+request:a_category+}" attachment_tag="{+request:a_tag+}"]
In the form I changed the name=
attributes for your two controls, just to make things clear. The shortcode contains two parameters that use the form results to filter the gallery:
attachment_category="{+request:a_category+}" attachment_tag="{+request:a_tag+}"
This uses the ‘Simple Taxonomy Parameters, “tax_operator”‘ described in the Documentation tab. I have added a tax_relation=OR
parameter as well. This will select items that match either the category selection OR the tag selection. If you want to require a match on both selections, change the parameter to tax_relation=AND
.
I hope that answers your three questions. If you have any questions or problems, post an update here. If you want to pursue the Google Analytics project, it would be great if you can open a new support topic for that specific question to make it easier to continue the dialog.