When website of Organiser is empty hide this .
I've tried with this shortcode and conditional
[wpv-conditional if="( $(_OrganizerWebsite) ne '' )"]
Website: [wpv-post-field name='_OrganizerWebsite' id='[wpv-post-field name="_EventOrganizerID"]']
[/wpv-conditional]
What am I doing wrong here?
I've also tried to use _EventOrganizerID in conditional
Hello and thank you for contacting the Toolset support.
I am not sure of the following assumptions and the names of the plugin's custom post types :
- _OrganizerWebsite is a custom field of the "Organizer" custom post type.
- _EventOrganizerID is a custom field of the "Event" custom post type. It holds the "Organizer" post id.
If the above is correct, I'll suggest that you use an intermediary content template. And include it by passing the item attribute:
[wpv-post-body view_template="the intermediary content template" item="[wpv-post-field name="_EventOrganizerID"]"]
As we will be passing the Organizer object to this content template, "_OrganizerWebsite" will evaluate inside the conditional, and we won't need to pass the organizer id any more, something like:
[wpv-conditional if="( $(_OrganizerWebsite) ne '' )"]
Website: <a href="[wpv-post-field name='_OrganizerWebsite']" target="_blank" rel="noopener">[wpv-post-field name='_OrganizerWebsite']</a>
[/wpv-conditional]
Does it make sense?
Check the following articles:
- https://toolset.com/documentation/programmer-reference/views/views-shortcodes/item-attribute/
- https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#vf-153372
I hope this helps. Let me know if you have any questions.