• Resolved penguintrax

    (@penguintrax)


    I am trying to set up a searchable gallery of images for my art organization. I have managed to get the search box to work and the next step is having it search the media library by attachment_tag and/or WordPress tags. Second, I’d like the resulting gallery to be lightbox enabled.

    Here are the two shortcodes I’m testing, but basically, I need to merge them into a single one. I hope you can help me, because I think I’ve reached the ‘over my head’ stage.

    <form id="mla-search-form" action="." method="post"><input id="mla-search-box" name="search-string" type="text" value="" /> <input id="submit" name="submit" type="submit" value="Search" /></form>[mla_gallery s="{+template:({+request:search-string+}|a-bad-term)+}" mla_nolink_text="Enter a search value above to display gallery."]
    
    [mla_gallery attachment_tag="jewelry" link="lightbox" mla_alt_shortcode="su_custom_gallery" mla_alt_ids_name="source" mla_alt_ids_template="media: {+alt_ids+}"]

    The page I need help with: [log in to see the link]

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

    (@dglingren)

    Thanks for describing your goal and for your initial experiments as documented in your form and shortcode source text. Thanks as well for the link to your test page; very helpful.

    You wrote “I am trying to set up a searchable gallery of images“. MLA provides three ways to filter your Media Library to produce a gallery display:

    1. The “Keyword Search”, for matching words and phrases in WordPress fields such as Title, Caption and Description. You can also extend this search to taxonomy term names. This is the search form you have been experimenting with
    2. The “Terms Search”, a more powerful way to match words and phrases in taxonomy term names.
    3. The “Tag Cloud” and “Term List” controls, which display taxonomy terms and allow the user to select one or more values from the display.

    You also wrote “I’d like the resulting gallery to be lightbox enabled.” Based on the shortcodes you have supplied it looks like you are using the “Custom Gallery” in the “Shortcode Ultimate” collection. Here are two earlier topics using that gallery/lightbox plugin:

    Working with shortcode libraries – a simple application of the Custom Gallery shortcode.

    Need help – shows how to combine a Tag Cloud with a Custom Gallery display.

    First, though, let me address your immediate “I need to merge them into a single one. requirement. Here is a solution that allows the user to search for keywords like “Brooch” or “Bracelet” within all the items assigned to the “jewelry” term in the “Att. Tags” taxonomy:

    <form id="mla-search-form" action="." method="post">
    <input id="mla-search-box" name="search-string" type="text" value="" /> 
    <input id="submit" name="submit" type="submit" value="Search" />
    </form>
    
    [mla_gallery]
    attachment_tag="jewelry"
    s="{+template:({+request:search-string+}|a-bad-term)+}"
    link="lightbox"
    mla_alt_shortcode="su_custom_gallery"
    mla_alt_ids_name="source"
    mla_alt_ids_template="media: {+alt_ids+}"
    mla_nolink_text="Enter a search value above to display gallery."
    [/mla_gallery]
    

    Basically I have combined the parameters from your two shortcodes into just one. I have used the “enclosing shortcode syntax” to spread the parameters out over several lines and make them easier to read.

    You can explore the earlier topics and the Tag Cloud/Term List examples in the Settings/Media Library Assistant Documentation tab to get more ideas for filtering the items. I will leave this topic unresolved for now in case you have problems or further questions regarding the above suggestions. Thanks for your interest in the plugin.

    Thread Starter penguintrax

    (@penguintrax)

    David –

    This is very helpful, but I need to be able to set the attachment_tag= to whatever is put in the search box. I think I can work with what you’ve given me and if I run into problems, I’ll get back to you.

    Many thanks,
    Barbara

    • This reply was modified 3 years, 9 months ago by penguintrax.
    Plugin Author David Lingren

    (@dglingren)

    Thanks for your update and the clarification on your application goal. Here is an earlier topic you might find helpful:

    Searching Keywords, a bit confused…

    Let me know how that works out and if you need more specific guidance.

    Plugin Author David Lingren

    (@dglingren)

    It has been over a month since my last post in this topic. I assume you have found a solution for your application.

    I am marking this topic resolved, but please update it if you are still need more specific help. Thanks for your interest in the plugin.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Search by Tags and Push to lightbox gallery’ is closed to new replies.