Problem:
The user would like to allow visitors to display the results of the view, either as a list or as a grid.
Solution:
Currently, there is no built-in way to switch view design on Toolset Views or Toolset Blocks. But I believe this can be done either, by Javascript and CSS, or by using two different content templates and conditionally display one or the other based on a URL param that can come from a custom control.
- Javascript/CSS: You can build a Javascript function that will add a custom CSS class to the view ("grid" or "list"), and you can build custom CSS scoped to those CSS class to style the output differently.
- Different content template: If you are using legacy Views instead of blocks, you may use the wpv-search-term shortcode and conditional shortcodes to display a different content template for each design.
Relevant Documentation:
https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#vf-214940
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.
Our next available supporter will start replying to tickets in about 5.02 hours from now. Thank you for your understanding.
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
9:00 – 13:00 | 9:00 – 13:00 | 9:00 – 13:00 | 9:00 – 13:00 | - | - | 9:00 – 13:00 |
14:00 – 18:00 | 14:00 – 18:00 | 14:00 – 18:00 | 14:00 – 18:00 | - | - | 14:00 – 18:00 |
Supporter timezone: Africa/Casablanca (GMT+01:00)
This topic contains 2 replies, has 2 voices.
Last updated by 4 years, 4 months ago.
Assisted by: Jamal.