• Resolved Philbeaux

    (@philbeaux)


    I’m trying to make a simple search form but I want results from within a specific attachment_category.
    Unfortunately, it’s bringing up results from the entire library.

    What am I doing wrong?

    Link an example: https://www.nosaintshistory.com/mla-examples/

    Here is the code I’m using at the moment.

    
    <form id="mla-search-form" action="." method="post">
    <input id="mla-search-box" name="search-string" type="text" value="" />&nbsp;<input id="submit" name="submit" type="submit" value="Search" />
    </form>
     
    [mla_gallery s="{+template:({+request:search-string+}|a-bad-term)+}" mla_search_fields=titles mla_terms_taxonomies=attachment_category attachment_category="no-saints-cards" posts_per_page=12 mla_output="paginate_links,prev_next" mla_link_href="{+page_url+}?search-string={+request:search-string+}"]
     
    [mla_gallery s="{+template:({+request:search-string+}|a-bad-term)+}" mla_nolink_text="Enter a search value above to display gallery." posts_per_page=12]
    

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

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

    (@dglingren)

    Good to hear from you again, and thanks for including the complete source text of your form and [mla_gallery] shortcodes; very helpful. I believe a few simple changes to the shortcodes will get you the results you seek.

    First, you must use exactly the same data selection parameters in both of your shortcodes. For your application, the mla_search_fields and attachment_category parameters must be added to the second shortcode, which displays the gallery results.

    Second, you must change “titles” to “title” in the mla_search_fields parameter.

    Finally, the mla_terms_taxonomies parameter can be removed since you are not using “terms” as a keyword search field.

    So, your form and shortcodes should look like this:

    <form id="mla-search-form" action="." method="post">
    <input id="mla-search-box" name="search-string" type="text" value="" />&nbsp;<input id="submit" name="submit" type="submit" value="Search" />
    </form>
     
    [mla_gallery s="{+template:({+request:search-string+}|a-bad-term)+}" mla_search_fields=title attachment_category="no-saints-cards" posts_per_page=12 mla_output="paginate_links,prev_next" mla_link_href="{+page_url+}?search-string={+request:search-string+}"]
     
    [mla_gallery s="{+template:({+request:search-string+}|a-bad-term)+}" mla_search_fields=title attachment_category="no-saints-cards" posts_per_page=12 mla_nolink_text="Enter a search value above to display gallery."]
    

    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 continued interest in the plugin.

    Thread Starter Philbeaux

    (@philbeaux)

    Once again David, you come through.
    Thank You so much.I know you’ve heard it before, but you’re support is absolutely amazing.
    And I’m not just saying that. The amount of support you give to a free plugin is beyond commendable. Other developers should take a lesson from you. I honestly don’t get your level of support from software products I’ve paid for – and that’s the truth.

    Keep up the good work and be safe!

    Thread Starter Philbeaux

    (@philbeaux)

    Oh – And I also want to thank you for taking the time to explain what I did wrong and how to correct that. Very encouraging.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Search Within a Specific Custom Taxonomy’ is closed to new replies.