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 - 1,681 through 1,695 (of 2,115 total)
Problem: I have a View that displays posts. I would like to add a button to each result that triggers a popup dialog with more information about each post. Is there a plugin or addon available for displaying popups with Toolset?
Solution: Toolset does not provide a built-in popup or modal dialog component, but gives you the ability to enqueue the Bootstrap library in Toolset > Settings > General.
The Bootstrap library comes with a built-in modal component that can be used to display popups like you have described.
There is no built-in integration for modals like these in the Block Editor, so custom HTML is required. After enabling the Bootstrap 4 library, add custom HTML to trigger and display modal overlays in your Content Templates and Views. You can place this code in a custom HTML block or in a separate Content Template, then embed that template with the Content Template block. Here is the HTML for an example modal, including the post title in the modal header and the post content and a simple custom field in the modal body:
<!-- Movie modal trigger button -->
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#movieModal-[wpv-post-id]">
View More
</button>
<!-- Movie modal -->
<div class="modal" tabindex="-1" id="movieModal-[wpv-post-id]" aria-labelledby="movieModalLabel-[wpv-post-id]" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<!-- Movie modal header -->
<div class="modal-header">
<h5 class="modal-title" id="movieModalLabel-[wpv-post-id]">[wpv-post-title]</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">x</span>
</button>
</div>
<!-- Movie modal body -->
<div class="modal-body">
<!-- modal body showing the main post content and a simple custom field -->
[wpv-post-body view_template="None"]<br />
[types field="my-field-slug"][/types]
</div>
<!-- Movie modal footer -->
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
If you place this code in a custom HTML block in your View's loop, a modal will be generated for each item in the loop and a button will be displayed to open the corresponding modal. Notice I have used the wpv-post-id shortcode in the modal structure to create dynamic, unique IDs for each modal in the loop of results. Dynamic IDs are necessary to connect the triggers and modals for each item in the results. You can modify this example code to include your Toolset Types custom fields and other content using our shortcode library.
Problem: I have placed a View in one of my BB Themer designs. When I activate this element in BB Themer, the page layout is broken.
Solution: Limit the use of Loop Templates in Views and other implementations of Content Templates when using 3rd-party templating systems like BB Themer, Elementor, etc. Content Templates often conflict with these other 3rd-party templating systems, so if you replace the Loop Template shortcode (wpv-post-body) in the loop of a View with the contents of that template, you can avoid this compatibility issue. See the screenshots below for more details about this.
Problem: I have a custom search WP Archive for a taxonomy that uses custom search. I have set the search feature to display only those options that would produce results. If I select one option, the options update as expected, but when the page loads all options are displayed. I have included other Views on the page.
Solution: In this case, it seems that omitting the filters from other Views included on the page is responsible for producing the problem in the archive filters. The filters were omitted by removing the wpv-filter-meta-html shortcode in the Output Editor. Replace the filter shortcode in the Output Editor of the other Views to solve the problem:
Problem: I would like to know if it is better to include User data in User fields in the User profile, or to create a proxy post type as explained in the documentation for post relationships and custom search for Users?
Solution: There are pros and cons for each approach. If you plan to use custom search Views to search for Users based on filtering by these custom fields, or if you plan to use Repeatable Field Groups for some of these fields, or if you plan to use post relationships to connect multiple Users to the same post, a proxy post type is probably required as explained in the documentation link below.