Paul Musgrave
Support threads created in the last 30 days: 0
Favorite Forum Topics
This user has no favorite topics.
Forum Topics Created
Status | Topic | Supporter | Voices | Posts | Freshness |
---|---|---|---|---|---|
Display a default message in a view if multiple repeating fields are input
Started by: Paul Musgrave
in: Toolset Professional Support
Problem: I have a custom post type of "events". For each event I have a date field. Most events are single occurrences but some occur multiple times during a day, or on several days across a week for example - so I have this setup as a field that allow multiple instances. I want to display these events in a compact view on my homepage. However, when there are multiple date entries, this can start to get quite untidy with long lists of dates for some events. What I would like to do in my VIew is the following: • If the event only has one date instance, show it. Solution: I suggest you use Views shortcode [wpv-conditional] shortcode to check if the custom date has multiple instances, then display what you want, for example, the custom date field slug is "event-date": [wpv-conditional if="'[wpv-post-field name="wpcf-event-date" index=1]' eq ''" evaluate="false"] This event runs from [types field='event-date' style='text' format='F j, Y' index=0][/types] on various dates. Please click for full details. [/wpv-conditional] [wpv-conditional if="'[wpv-post-field name="wpcf-event-date" index=1]' eq ''" evaluate="true"] If the event only has one date instance, show it. [types field='event-date' style='text' format='F j, Y' separator=', '][/types] [/wpv-conditional] Please replace "event-date" with your custom date field slug Relevant Documentation: https://toolset.com/documentation/user-guides/conditional-html-output-in-views/ |
2 | 4 | 6 years, 10 months ago | ||
Excluding ceratin posts from a view
Started by: Paul Musgrave
in: Types Community Support
Problem: I've a custom content type created using Toolset Types called "offers". I'm surfacing these on a page on my site using a View. However I want to exclude certain offers from this view. In the post fields I've added a checkbox "exclude from listing". If this is checked when entering an event, I want this to not display in the View. I'm thinking this could be achieved through a query filter, but I'm struggling to work out how. Solution: It depends on how you setup the custom checkbox field "hide from listing", for example, you can edit the custom checkbox field "hide from listing", option "Value to store" fill number "1", see screenshot hide-from-listing.JPG, https://cdn.toolset.com/wp-content/uploads/2018/03/621231-hide_from_listing.JPG Then in your view, screenshot: You can setup the filter in view, like this: hide from listing is a number equal to 1 Relevant Documentation: |
2 | 3 | 6 years, 10 months ago |