Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author David Lingren

    (@dglingren)

    Thanks for you question. I can offer you a simple solution along the same lines as in this earlier support topic:

    Front-end filtering

    You can add this code to a page (or post) using the “Text” tab on the editor (NOT the “Visual” tab):

    Please select an item type:
    
    <form id="attachment-tag-form" method="get" action="">
    	<select name="item_type" class="postform">
    		<option selected="selected" value="all">-- All Item Types --</option>
    		<option value="image">All Image Items</option>
    		<option value="audio,video">Audio/Video Items</option>
    		<option value="application/pdf">PDF Documents</option>
    		<option value="application/vnd.ms-excel">XLS Documents</option>
    		<option value="application/*ms*">Microsoft Documents</option>
    	</select>
    	<input type="submit" id="submit" name="submit" value="GO">
    </form>
    <h3>Results</h3>
    [mla_gallery post_parent=all post_mime_type="{+request:item_type+}"]

    I have included several different MIME Types in the list to give you an idea of what can be done. You can find the MIME types assigned to your items in two ways:

    1. Go to the Media/Assistant submenu, pull down the “Screen Options” area in the upper-right corner of the screen and check the box to the left of “MIME Type”. This will add a column to the table with the types assigned to your items.
    2. Go to the Settings/Media Library Assistant Uploads tab. The MIME Type column there will give you the type assigned to each file extension used by your items.

    When you select an Item Type from the list and click “Go” the MIME type is placed in the “tem_type” query argument and the page is refreshed; you can see the new argument in the URL. The post_mime_type="{+request:item_type+}" parameter in the [mla_gallery] shortcode uses item_type to filter its results.

    More complex solutions would require WordPress Template files and some PHP coding, but this is a solution you can put into the content of any post or page.

    I hope that gets you started on building the gallery results you need. I am marking this topic resolved, but please update it if you have any problems or further questions about the solution. Thanks for your interest in the plugin.

    Thread Starter whoaloic

    (@whoaloic)

    Thank you for you answer but I forgot to clarify I need to filter media type in the admin media library in order to find easier media.
    Regards.

    Plugin Author David Lingren

    (@dglingren)

    Thank you for clarifying your question, which I did not understand from your first post. I regret my confusion.

    In the Media/Assistant submenu, filtering by media type is provided by the “Views” that appear just below the submenu title, e.g., “All”, “Images”. There is no feature in the current MLA version to create a dropdown list on this screen, but you CAN add as many additional Views as you want to.

    If you go to the Settings/Media Library Assistant Views tab you will see “Add New View” on the left-hand side of the submenu, and a “Table View” column in the table on the right-hand side. You can add a new PDF Documents view, for example, by filling in the left-hand side fields:

    • Slug: application/pdf
    • Singular Label: PDF Doc
    • Plural Label: PDF Docs
    • Specification: leave blank for this example
    • Post MIME Type: check this box
    • Table View: check this box
    • Menu Order: leave blank, or fill it in to re-order the views
    • Description: optional; up to you

    Then scroll to the bottom of the screen and click “Add View” to save your work. Here is another example:

    • Slug: microsoft
    • Singular Label: MS Doc
    • Plural Label: MS Docs
    • Specification: application/*ms*
    • Post MIME Type: uncheck this box
    • Table View: check this box
    • Menu Order: leave blank, or fill it in to re-order the views
    • Description: optional; up to you

    When you return to the Media/Assistant submenu the new view(s) will appear in the list. If the list gets long it will interfere with the “Search Media” box. You can improve the display by going to the Settings/Media Library Assistant General tab and scrolling down to the “Views Width” section. Enter something like “540px”, then scroll to the bottom and click “Save Changes”. When you return to the Media/Assistant submenu the lists will appear in multiple, narrower rows.

    I hope that answers your actual question; sorry for my confusion in the first response. Please let me know if you have any trouble with the solution I have outlined, and thanks for your patience.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Filter by post type file’ is closed to new replies.