Views plugin lets you build your own custom search for any content type. These searches can be based on post content, taxonomies and custom fields.
When you ask for help or report issues, make sure to tell us settings for your custom search.
Viewing 15 topics - 361 through 375 (of 754 total)
Problem:
A view's taxonomy filter does not display some terms until the user adds more than one post to the term.
Solution:
The view displays the media files, which do not have the status set to publish. In that case, Toolset will search for their parent post status. And the status should be "publish" or "private".
The terms that the user talks about were including only one post, and that post did not have the status "publish" or "private" and it did not have a parent post either.
The media files need to be attached to a post, or the view needs to query media files in all statuses.
Problem: I have a series of search filters displayed as checkboxes. The checkboxes are displayed in a single column with several rows. Instead, I would like to display the checkboxes in a single row with multiple columns. If I inspect the checkbox containers I can see they are set to display:inline-block; but they break to separate rows. How can I display the checkboxes in a single row?
Solution: Use custom CSS to override the default layout styles for the checkbox elements. In this case, applying display:flex to the checkboxes container element is sufficient to implement the flexbox model and display the filters in a single row with multiple columns.
Problem: I have implemented the select2.js library and replaced the select filters in my custom search View with select2 elements. After submitting search filters, Views updates the results using AJAX and the select2.js filters are replaced with default select fields. I would like to reinitialize the select2 filters after an AJAX update in the View.
Solution: Views search filters are replaced during AJAX result updates, so any customizations you perform to the filters must be reapplied after an AJAX update. In the legacy Views editor, you can use the Front-end Events button in the Search and Pagination editor area to insert event hook templates for various events available in the Views and Maps systems. Use the search results updated event hook to trigger custom JavaScript code that reinitializes the select2.js elements in custom search filters. The event hook callback template looks like this:
jQuery( document ).on( 'js_event_wpv_parametric_search_results_updated', function( event, data ) {
/**
* data.view_unique_id (string) The View unique ID hash
* data.layout (object) The jQuery object for the View layout wrapper
*/
// Add your own custom JavaScript here to initialize the select2 element again
});