Problem:
I'm building a real estate website.
A Property is a kind of domain with a list of available items (I called them "Lots" : houses, apartments, chalet, etc...) and has multiple custom fields.
One is what the property contains: type of "Lots" and quantities (fields from a repeatable group of fields).
How much apartments, how much houses, etc
With a View I can display which item and how many pieces there are.
BUT I'd like to set a conditional display based on the quantities. Add a "s" if there is more than 1 item and display a svg related to the item. The pictograms will be different if it's an apartment or a house. In order to achieve the kind of result in the attached picture.
Solution:
You need to setup a child post view:
https://toolset.com/course-lesson/displaying-related-posts/#displaying-many-related-items
In the section "Loop Editor" of above child post view, you can get the found post count with shortcode [wpv-found-count]:
https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#wpv-found-count
Use it as condition of shortcode [wpv-conditional], and display different result:
https://toolset.com/documentation/legacy-features/views-plugin/using-shortcodes-in-conditions/
Relevant Documentation:
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.
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: Asia/Hong_Kong (GMT+08:00)
This topic contains 3 replies, has 2 voices.
Last updated by 4 years, 3 months ago.
Assisted by: Luo Yang.