• Resolved trinitaa

    (@trinitaa)


    Hi,
    This is a great plugin.This helps a lot to my project now i have one issue.I have created a filter to filter the posts,pdfs, and images.Below is the code for my filter.
    <form id=”attachment-category-form” action=”.” method=”post”>
    <div class=”catlist”>

    Category Search

    [mla_term_list taxonomy=”category,attachment_category” mla_item_parameter=”current_category” mla_output=dropdown option_all_text=All option_all_value=all hierarchical=true pad_counts=true use_filters=true mla_option_value=”{+slug+}” mla_phrase_delimiter=’ ‘ mla_phrase_connector=’OR’]

    </div>
    Tag Search
    <div class=”searchlist”>[mla_term_list taxonomy=attachment_tag mla_item_parameter=current_attachment_tag mla_output=dropdown option_all_text=All option_all_value=all hierarchical=true pad_counts=true use_filters=true mla_option_value=”{+slug+}” mla_phrase_delimiter=’ ‘ mla_phrase_connector=’OR’]</div>
    Active and Archive Filter
    <div class=”searchlist”>[mla_term_list taxonomy=room mla_item_parameter=current_attachment_tag mla_output=dropdown option_all_text=All option_all_value=all hierarchical=true pad_counts=true use_filters=true mla_option_value=”{+slug+}” mla_phrase_delimiter=’ ‘ mla_phrase_connector=’OR’]</div>
    Keyword Search
    <div class=”searchlist”>[muie_keyword_search mla_phrase_delimiter=’ ‘ mla_phrase_connector=’OR’]</div>
    <input id=”category-form-submit” name=”category_form_submit” type=”submit” value=”Search” />

    </form>[mla_gallery numberposts=6 add_filters_to=any mla_output=”paginate_links,prev_next” post_parent=all link=”{+guid+}” post_type=any post_mime_type=all post_status=any option_all_value=all]
    [mla_gallery numberposts=6 add_filters_to=any mla_nolink_text=”No items match the current filter selections.” link=”{+guid+}” post_type=any post_parent=all option_all_value=all post_status=any post_mime_type=all]

    I want to list out the attachment_category and category taxonomies in the same dropdown and also it should be filter as well.Actually i tried to add the two different taxonomies using comma in the category search but it is not working. can you please me to resolve the issue?

    Thanks for all your help.

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

    (@dglingren)

    Good to hear from you again, and thanks for the kind words. Thanks as well for posting the entire source text of your form and shortcodes; very helpful. It looks like you are working on some changes to the solution developed for this earlier topic:

    Shortcode

    Is that right? If so, I assume you are using the MLA UI Elements Example plugin as part of your application, right?

    Using one [mla_term_list] shortcode for multiple taxonomies will only work in certain circumstances. In fact, it will not work at all with mla_output=dropdown because the taxonomy is part of the name parameter for the dropdown control and all of the values in the control must be in that one taxonomy. I will have to update the Documentation to be clear on this point.

    I want to make sure I understand your goal. You want the “Category Search” to pick one term from either the category or the attachment_category taxonomy. Is that right?

    You also want to pick one “Tag Search” term from the attachment_tag taxonomy and one “Active and Archive Filter” term from the room taxonomy. Then, an item must match all three of the terms to be included. Is that right?

    It may be possible to modify the MLA UI Elements Example plugin to implement the two-taxonomy dropdown control. I want to make sure I know what you want before I proceed. Any additional information you can provide will be most helpful.

    Thread Starter trinitaa

    (@trinitaa)

    Thankyou so much for your reply.yes your understanding is right. I want to pick one term from either the category or attachment-category taxonomy but I want both these taxonomies list in the same dropdown, and also want to pick one from attachment_Tag and one from room taxonomy so it should filter by using all three criteria. Actually the filter is working perfectly still trying to combine the two taxonomies in category search.if I’m trying to combine two taxonomies that’s where the filter is not working.Can you understand my goal? Is that possible?

    Plugin Author David Lingren

    (@dglingren)

    Thank you for confirming my understanding of your goal. I will have a look at the code and post an update here when I have progress to report.

    Plugin Author David Lingren

    (@dglingren)

    I have made a number of changes to the MLA Development Version and to the MLA UI Elements Example plugin. They extend [mla_term_list] multiple taxonomy handling so it will work in a dropdown control, and adds an mla_control_name parameter to support multiple dropdown controls on a post/page. Together, the enhancements enable a solution to your application requirements. Here is a complete replacement for the form you gave in your first post in this topic:

    
    <form id="attachment-category-form" method="post" action=".">
    <p>
    Category Search
    <div class="catlist">
    [mla_term_list]
    taxonomy="attachment_category,category"
    mla_output=dropdown hierarchical=combine use_filters=true
    option_all_text=All option_all_value=all
    show_count=true pad_counts=true
    mla_control_name=category_dropdown
    mla_item_parameter=current_attachment_category
    [/mla_term_list]
    </div>
    </p>
    <p>
    Tag Search
    <div class="searchlist">
    [mla_term_list taxonomy=attachment_tag mla_output=dropdown use_filters=true option_all_text=All option_all_value=all show_count=true mla_option_value="{+slug+}" mla_control_name=tag_dropdown mla_item_parameter=current_attachment_tag]
    </div>
    </p>
    <p>
    Active and Archive Filter
    <div class="searchlist">
    [mla_term_list taxonomy=room mla_output=dropdown use_filters=true option_all_text=All option_all_value=all show_count=true mla_option_value="{+slug+}" mla_control_name=room_dropdown mla_item_parameter=current_room]
    </div>
    </p>
    <p>
    Keyword Search
    <div class="searchlist">
    [muie_keyword_search mla_phrase_delimiter=' ' mla_phrase_connector='OR']
    </div>
    </p>
    <input id="attachment-category-form-submit" name="attachment_category_form_submit" type="submit" value="Search" />
    </form>
    
    [mla_gallery numberposts=6 add_filters_to=any mla_output="paginate_links,prev_next" post_parent=all post_mime_type=all option_all_value=all]
    [mla_gallery numberposts=6 add_filters_to=any mla_nolink_text="No items match the current filter selections." link=file post_parent=all post_mime_type=all option_all_value=all]
    

    For the “Category Search” shortcode I have used the “enclosing shortcode” syntax to make it easier to enter and read the parameters. Here are some comments:

    1. The taxonomy="attachment_category,category" parameter includes both of the taxonomies you want to filter on.
    2. The new hierarchical=combine parameter combines the two taxonomies in a single dropdown control. All the terms for attachment_category appear first, then the category terms.
    3. The new mla_control_name=category_dropdown parameter gives a unique name to the control.

    The “Tag Search” and “Active and Archive Filter” shortcodes have a few changes. In particular, the hierarchical=true parameter is removed because flat taxonomies do not need it. I have also removed the mla_phrase_delimiter abnd mla_phrase_connector parameters, which are not used in this shortcode.

    In the [mla_gallery] shortcodes I removed a few parameters and changed link={+guid+} to the more reliable link=file equivalent.

    I have uploaded a new MLA Development Version dated 20170122 that contains the [mla_term_list] enhancements and an updated MLA UI Elements Example plugin. To get the Development Version, follow the instructions in this earlier topic:

    Shortcode not working in (special) widget

    Once the Development Version is installed, navigate to the Settings/Media library Assistant Documentation tab and click the “Example Plugins” button. Type “user” in the text box and click “Search Plugins” to filter the table.

    You are looking for “MLA UI Elements Example” plugin. Find that plugin and hover over the title in the left-most column. Click the “Update” rollover action, then go to the WordPress Plugins/Installed Plugins submenu and verify that the new version is in place.

    It would be great if you can install the Development Version and updated example plugin and let me know if they work for you using the replacement form I included above. Thanks for your patience while I worked this out and for inspiring an MLA enhancement.

    Plugin Author David Lingren

    (@dglingren)

    It has been three months since the 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 have any problems or further questions regarding the above suggestions.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Dropdown filter with two different taxonomies’ is closed to new replies.