2. Register both shortcodes first ‘get_selected_filter’ and ‘incrementor’ in Toolset >> Settings >> Front-end Content >> Third-party shortcode arguments.
3. Then you can use these shortcodes in the View like this (its recommend to use in “Templates for this View” section since you are using ajax):
[php]
[wpv-conditional if="( '[incrementor]' eq '1' )"]
[get_selected_filter taxonomy="bedcategory"] // replace taxonomy name here
[get_selected_filter taxonomy="gender"]
[/wpv-conditional]
[php]
Other solution could be using Custom jQuery code as client has done here:
https://toolset.com/forums/topic/displays-terms-in-wpv-items-found/#post-562040
This support ticket is created 7 years, 3 months ago. There's a good chance that you are reading advice that it now obsolete.
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
I have a custom search with an Icon for each taxonomy term I'm using but for the sake of making this easier, lets just say I have a taxonomy with 5 terms, I select "term 1" and search via Ajax using submit button. Is there a way to list the terms selected inside the wpv-items-found so the user would have a quick view of what they have selected?
Thank you for contacting Toolset support. Please provide more information on what you would like to achieve.
Are you using Custom Search View (posts view) >> and would like to display Selected Term at the Top of the page (the term that is selected in the search form filter) >> and show it before search results?
Because the term that we select in search form, is already shown as selected in the form itself.
- Provide back-end screenshot of the View.
- Provide page link where I can see this.
hidden link - This should make sense now that you can see it, there will be multiple taxonomies along the top to select from so I want to have a list on the screen displaying what has been selected.
Thank you for providing more details and screenshots. We can display selected Terms on the page by using a custom shortcode. I am working on this right now and will update you with the outcome soon.
2. Register both shortcodes first ‘get_selected_filter’ and ‘incrementor’ in Toolset >> Settings >> Front-end Content >> Third-party shortcode arguments.
3. Then you can use these shortcodes in the View like this (its recommend to use in “Templates for this View” section since you are using ajax):
this was very helpfull thank you, however ending up not working for me as it needed to go inside the loop and I had to wrap it in a div I would have ended up with a lot of extra divs also I need to know what is selected when no results show up. I ending up using a JS version that seams to work for me updating on search updated.
jQuery( document ).on( 'js_event_wpv_parametric_search_results_updated', function( event, data ) {
var radios = document.querySelectorAll('input[type="radio"][name="radio-name"]:checked');
var value = radios.length>0? radios[0].value: null;
// do something
});