Views is a WordPress plugin that lets you easily display content on your website's front-end in any way you choose.
Views User Guides include detailed documentation for creating lists of content, templates for content and archive page and also explain how to create parametric searches for any content type.
When you ask for help or report issues, make sure to tell us the versions of the Toolset plugins that you have installed and activated.
Viewing 15 topics - 11,956 through 11,970 (of 12,059 total)
Problem:
A View lists posts, and also displays the same results as markers on a map. How to click on a post result and have the map focus on the corresponding marker?
Solution:
You can insert a button for each post into the View results with a required attributes that will focus the map on the marker, like so:
<button class="js-wpv-addon-maps-focus-map" data-map="map-name" data-marker="marker-[wpv-post-id]">
Focus on marker</button>
Problem: I would like to group posts in a View by post reference field's post title.
Solution: Update the custom code to group by the post reference field raw value, which is a post ID. Then display the title of the post reference field.
Problem: I have a custom search View with several search fields placed on a page. Only the search form, not the results, are shown on the page. The View is set up to redirect to a different URL, where the filters and results are both displayed. When Users visit the first page, the URL will have a parameter "promocode" with some variable. When the page redirects to the next step, I want to maintain the original URL parameter on the results page.
Solution: Use the View filter "wpv_filter_end_filter_form" to add a hidden input field to the custom search form, and set the value of the field by accessing the URL parameter in the $_GET superglobal:
Then if your View is set up to "only show available inputs" you'll need to add some custom JavaScript to update the hidden promocode field any time the filters are updated:
jQuery( document ).on( 'js_event_wpv_parametric_search_form_updated', function( event, data ) {
var url = new URL(window.location);
var promocode = url.searchParams.get("promocode");
jQuery('#promocode').val(promocode);
});
The issue was that the user had types 3.0 installed and wasn't able to update their plugins.
Solution:
This was an issue with the installer on version 3.0 of Types so you will need to perform a manual installation of the Types plugin. https://toolset.com/account/downloads/
Problem:
How to create striped results for a View output?
Solution:
Add different classnames for each loop iteration, either by using the even and odd values for the index attribute of the wpv-item shortcode, or as described below using the index=1 and index=2 attributes and adding the wrap="2" attribute to the wpv-loop tag to make them repeat: https://toolset.com/forums/topic/changing-row-colors-in-a-view/#post-1128171