• Resolved computercarl

    (@computercarl)


    This may be a RTFM issue, but I am looking for the quickest way to do what it is I need to do.
    I have a project requiring approximately 10 categories. For illustration’s sake, let’s say that there are cats and dogs available in 5 different colors.
    I think I am to the point where I could create ten pages, and on each page insert some gallery shortcode which would produce the required results. However, this is all about computer programming, so I am looking for the correct way.
    I would like to create ten links (e.g., “black, cat”, “red, dog”) and when I click that link, would like to be presented with a “results page” containing all of the media items tagged/categorized with those items.
    Could you possibly show me what one of these links would look like along with the shortcode for the “results viewer” page?

    Thank you,
    carl

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

    (@dglingren)

    Thanks for your question and for the details on your application needs.

    As you suspected, you can find one solution in the “MLA Term List Examples” section of the Settings/Media Library Assistant Documentation tab. The simple example there has an HTML form with a dropdown control listing the terms and displays a paginated gallery of the items with a term once it is selected.

    There are many variations on this basic solution. For example, you can eliminate the form and substitute a list of hyperlinks by replacing the form with this alternative:

    [mla_term_list taxonomy=attachment_category mla_output=flat separator='<br />'
     mla_link_href='{+page_url+}?tax_input{attachment_category}={+slug+}'
     show_count=true pad_counts=false ]
    

    A variety of list and checkbox formats are available. The above examples assume you have created a single list of terms, e.g. “black cat”, “red dog” and “black dog”. You could instead create separate terms for color and animal. This would require a somewhat different approach.

    I hope that gets you started on a solution for your application. I am marking this topic resolved, but please update it if you have any problems or further questions regarding the above suggestions. Thanks for your interest in the plugin.

    Thread Starter computercarl

    (@computercarl)

    Thank you for for quick response! I am still having issues, however.

    When I use the code directly from the “MLA Term List Examples”, I have a blank gallery regardless of the category item count in the drop-down.

    
    <form id="mla-text-form" action="." method="post" class="row">
    <strong>Att. Categories</strong>
    [mla_term_list taxonomy=attachment_category mla_output=dropdown mla_option_value="{+slug+}" show_count=true pad_counts=false ]
     
    <input id="text-form-submit" name="text_form_submit" type="submit" value="Search" />
    </form>
     
    <h3>Gallery</h3>
    [mla_gallery]
    attachment_category="{+template:({+request:tax_input.attachment_category+}|no-term-selected)+}"
    posts_per_page=3 mla_output="paginate_links,prev_next"
    mla_link_href='{+new_url+}?mla_paginate_current={+new_page+}&tax_input[attachment_category]="{+query:attachment_category,text+}"'
    [/mla_gallery]
     
    [mla_gallery attachment_category="{+template:({+request:tax_input.attachment_category+}|no-term-selected)+}" posts_per_page=3 mla_caption="{+title+} : {+description+}" mla_nolink_text="<br>Select a term to display the gallery.<br>"] 
    

    If I use another example which isn’t filtered, it will display items;
    [mla_gallery post_parent=all post_mime_type=application/pdf size=icon link=file]

    I am using WordPress 4.8.2

    • This reply was modified 7 years, 5 months ago by computercarl.
    Plugin Author David Lingren

    (@dglingren)

    Thanks for your update and for including the complete text of your shortcodes; very helpful. Thanks as well for taking the time to go through the Documentation and aapt the example there.

    Your second, unfiltered, example includes post_mime_type=application/pdf. I don’t see that parameter in the two [mla_gallery] shortcodes in the first example. The default value for this parameter is “image”, so if you are looking for PDF documents you need to add the post_mime_type=application/pdf to the two shortcodes in the first example.

    Let me know if that solves your problem.

    Thread Starter computercarl

    (@computercarl)

    That did the trick.. or part of the trick.
    The PDFs are now displaying, which is a huge help.

    I would like to display the filenames in a list with an icon, such as
    ?? Document of Immense Importantance.pdf
    ?? Secrets of the Universe.pdf
    ?? Unimaginable Intelligence for Dummies.pdf

    Also, is it possible to link to another page which will be affected by a link/form data on another page?

    
    _________________________          ________________________
    | page 'intro'          |          |  results page         |
    | link to category 'b'  |   ===>   |                       |
    |                       |          | list of cat 'b' items |
    |_______________________|          |_______________________|
    

    Is there a “getting started” guide or the like available? While I am 100% certain your software could make WordPress infinitely more versatile, I feel as if I’m reading a dictionary to learn a sail a boat.

    Thank you!

    Plugin Author David Lingren

    (@dglingren)

    Thanks for your update and the additional details about your needs. I am headed out of town for the weekend but I can give you more specific help next week. In the interim, here is an earlier article along similar lines (with links to additional topics) that you might find useful:

    pdf’s display in ul

    I understand your frustration with the documentation, which is more reference than tutorial. I wish I had the time and skills to do more in this regard, but it’s one reason I try to give as much help as I can in the support forum. Thanks for your interest and your understanding.

    Thread Starter computercarl

    (@computercarl)

    I haven’t tried the examples yet, but those articles appear to solve just what I’m trying to accomplish. I will ask additional questions next week if the material in those other topics doesn’t help.

    I appreciate the support, all the effort you have obviously put into this plugin, and offering it for free.

    Enjoy your weekend!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘A Search Form and Results’ is closed to new replies.