• Resolved tmacgregor

    (@tmacgregor)


    David, that is better, and thank you. However, i am still missing one component. When i search (for instance i type in order no 11-14-b) the result is nothing. It doesnt display possible pdf’s with that name. It only stays on same page. Eventually there will be thousands of admin orders. We want visitors to be able to either scroll through the orders or use a keyword or term to search more specifically and have the results displayed and when they choose the correct result, that pdf open. I hope I have explained it better and again thank you for your help.

    Trace
    —————–
    David Lingren wrote:

    @tmacgregor,

    Thanks for your question and for posting the complete source text of your page and shortcodes; very helpful. Your question deserves its own support forum topic, but I will answer it here for your convenience.

    Your page has a search form and three [mla_gallery] shortcodes.

    The first shortcode does not match any items because of its s= parameter, so it displays the “Enter a keyword… ” mla_nolink_text value.
    The second shortcode displays all of the PDF documents in the Media Library because it has no other filtering parameters.
    The third shortcode displays page navigation controls. It has an mla_terms_phrases filter.

    It looks like your intent is to display all of the PDF documents (or the first page of documents) when the page loads, and a filtered set when one or more keywords are entered that match terms assigned in the attachment_tag taxonomy. Is that right?

    If I understand your application correctly, a few changes should get you the results you need. First, you only need two shortcodes; one for the items and one for the page controls. Second, both of the shortcodes must have exactly the same data selection parameters, so the navigation controls match the gallery display. Finally, the action="." won’t work on your site because you are not using “pretty permalinks”. The “.” argument captures just the link portion of the URL, https://flcourts18.org/; it does not add the ?page_id=4762 query argument that specifies the page.

    Here is an alternative that should work for you:

    [su_box title="Search by Circuit, County, Division, Judge or Case Number" style="default" box_color="#333333" title_color="#FFFFFF" radius="9" class="background-image: url('https://flcourts18.org/wp-content/themes/catch-responsive-pro/images/body-bg.jpg')"]
    <form id="mla-search-form" action="https://flcourts18.org/?page_id=4762&quot; method="post"> <input id="mla-search-box" name="search-string" type="text" value="" />&nbsp;<input id="submit" name="submit" type="submit" value="Search" /> <p> Enter a keyword to search administrative orders.
    </p>
    </form>[/su_box]

    [mla_gallery]
    mla_terms_phrases="{+template:({+request:search-string+}|a-bad-term)+}"
    mla_terms_taxonomies=attachment_tag
    post_mime_type=application/pdf
    post_parent=all
    posts_per_page=12
    columns=1
    size=none
    mla_itemwidth=100
    link=file
    listtag=ol
    mla_caption="{+description+}"
    [/mla_gallery]
    <hr>
    [mla_gallery]
    mla_terms_phrases="{+template:({+request:search-string+}|a-bad-term)+}"
    mla_terms_taxonomies=attachment_tag
    post_mime_type=application/pdf
    post_parent=all
    posts_per_page=12
    mla_output="paginate_links,prev_next"
    mla_link_href="https://flcourts18.org/?page_id=4762&search-string={+request:search-string+}"
    [/mla_gallery]

    I have used the alternative “enclosing shortcode” syntax to break the shortcode up over several lines and make it easier to read and modify. Give this alternative a try and open a new support topic if you have any problems or further questions regarding the changes I’ve made. Thanks for your interest in the plugin.

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

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

    (@dglingren)

    Thanks for starting this new topic and separating it from your original post in the earlier All images has the same title, alt, description topic.

    In your latest post you wrote that you want to “display possible pdf’s with that name” and “use a keyword or term to search. I understand that to mean that you want to filter items based on words or phrases in fields like Title, Caption and Description as well as words or phrases that appear in the names of attachment_tag terms assigned to the items. Is that right? If so, an adjustment to the solution shown above will get you closer to your goal.

    The first solution used MLA’s “Taxonomy term keyword(s) search” to match words or phrases in taxonomy term names. As you report, it does not search in other item fields such as Title. You can add those fields to your search by using the “Keyword(s) Search” parameters in your shortcode. The Settings/Media Library Assistant Documentation tab gives more information on both types of searches.

    For your application the changes are straightforward. First, change the mla_terms_phrases parameter to s (the keyword search parameter). Second, add the mla_search_fields parameter to select the fields you want to search in. You can search on any of title, name, excerpt, content, file, and/or terms. The default is title, content and file. For your application you must add terms to extend the search to taxonomy term names. Here are the revised [mla_gallery] shortcodes for your application:

    [mla_gallery]
    s="{+template:({+request:search-string+}|a-bad-term)+}"
    mla_search_fields="title,content,file,terms"
    mla_terms_taxonomies=attachment_tag
    post_mime_type=application/pdf
    post_parent=all
    posts_per_page=12
    columns=1
    size=none
    mla_itemwidth=100
    link=file
    listtag=ol
    mla_caption="{+description+}"
    [/mla_gallery]
    <hr>
    [mla_gallery]
    s="{+template:({+request:search-string+}|a-bad-term)+}"
    mla_search_fields="title,content,file,terms"
    mla_terms_taxonomies=attachment_tag
    post_mime_type=application/pdf
    post_parent=all
    posts_per_page=12
    mla_output="paginate_links,prev_next"
    mla_link_href="https://flcourts18.org/?page_id=4762&search-string={+request:search-string+}"
    [/mla_gallery]
    

    Don’t forget to change BOTH of the shortcodes so the gallery display will match the page controls, and to remove the a-bad-term portion of the s parameter if you want to start with a display of all documents in the Media Library.

    I hope that gives you what you need. I am marking this topic resolved, but please update it if you have any problems or further questions regarding the above suggestions.

    Thread Starter tmacgregor

    (@tmacgregor)

    thank you i will try this. you are a nice person for helping a non programmer in need.

    Thread Starter tmacgregor

    (@tmacgregor)

    I have made the adjustments as you suggested, however, when i put in a term to search box, nothing happens yet. I want it to search the gallery (pdf’s) and have the search list its findings just like a normal search would. what am i missing?

    Plugin Author David Lingren

    (@dglingren)

    I regret the trouble you’re having with the solution I suggested. Can you post the full source text of your page so I can compare your code to mine?

    For test purposes you can also temporarily change the search parameter in both shortcodes to s="", which should display a list of all documents in the Library. If that works it would narrow down the possible cause. Thanks for any additional information you can supply.

    Thread Starter tmacgregor

    (@tmacgregor)

    Sure thing. Code is below. I changed the search parameter in both shortcodes to s=”” per your request. I have only 6 pdf’s listed and uploaded via media upload. These are for test purposes. Soon I will have about 600. The admin has decided not to list all orders. He just wants to offer the search box that only searches the pdfs uploaded to gallery. The results should be listed below search box so user can choose from there. I hope that helps.

    [su_box title=”Search by Circuit, County, Division, Judge or Case Number” style=”default” box_color=”#333333″ title_color=”#FFFFFF” radius=”9″ class=”background-image: url(‘https://flcourts18.org/wp-content/themes/catch-responsive-pro/images/body-bg.jpg&#8217;)”]

    <form id=”mla-search-form” action=”https://flcourts18.org/?page_id=4762&#8243; method=”post”><input id=”mla-search-box” name=”search-string” type=”text” value=”” />?<input id=”submit” name=”submit” type=”submit” value=”Search” /></br>Enter a keyword to search administrative orders.

    </form>[/su_box]

    [mla_gallery]
    s=”{+template:({+request:search-string+}|)+}”
    mla_search_fields=”title,content,file,terms,name,caption,description,tags,categories”
    mla_terms_taxonomies=attachment_tag
    post_mime_type=application/pdf
    post_parent=all
    posts_per_page=12
    columns=1
    size=none
    mla_itemwidth=100
    link=file
    listtag=ol
    mla_caption=”{+description+}”

    [/mla_gallery]
    [mla_gallery]
    s=”{+template:({+request:search-string+}|)+}”
    mla_search_fields=”title,content,file,terms”
    mla_search_fields=”title,content,file,terms,name,caption,description,tags,categories”
    post_mime_type=application/pdf
    post_parent=all
    posts_per_page=12
    mla_output=”paginate_links,prev_next”
    mla_link_href=”https://flcourts18.org/?page_id=4762&search-string={+request:search-string+}”
    [/mla_gallery]

    Plugin Author David Lingren

    (@dglingren)

    Thanks for posting your source text. It looks like the problem might be “smart/curly quotes” in the source text. It’s hard to tell whether the curly quotes in the text you posted are also present in the original text on your site, but let’s rule that out.

    First, make sure you are using the “Text” tab in the page editor, not the “Visual” tab.

    Second, go carefully through the source text for your shortcodes and change all the double-quote characters to plain text quotes, not smart/curly quotes.

    The other fix you should make is to use mla_search_fields="title,content,file,terms" in both your shortcodes. The longer version you have with the additional names doesn’t help. In my tests, it doesn’t hurt, but it’s confusing.

    On my test system the text you posted worked fine once I fixed the smart quotes. On your system the unfiltered display (just click “Search” without entering anything) is fine but entering a search term does not work. If you replace your s= parameter with a simple value such as s="supreme" do you get the SUPREME COURT ADMINISTRATIVE ORDER.: AOSC11-44 document?

    Can you also try posts_per_page=4 so the page controls will show up?

    Thread Starter tmacgregor

    (@tmacgregor)

    i have a snapshot of my code, how can i send that to you

    Plugin Author David Lingren

    (@dglingren)

    If you give me your contact information I will send you an email address you can use to send the information to me. You can use the Contact Us page at our web site:

    Fair Trade Judaica/Contact Us

    I look forward to seeing the information or hearing from you. Thanks for your help with this unusual issue.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘displaying PDF documents’ is closed to new replies.