[Resolved] Conditional Output for Editor Field/Box
The Toolset Community Forum is closed, for technical support questions, please head on to our Toolset Professional Support (for paid clients), with any pre-sale or admin question please contact us here.
This support ticket is created 7 years, 10 months ago. There's a good chance that you are reading advice that it now obsolete.
This is the community support forum for Types plugin, which is part of Toolset. Toolset is a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients and people who registered for Types community support can post in it.
I need to display a conditional message in my Content Template if the Editor field is empty. My staff custom post types have custom fields for tile/email/location/department. The post title is the persons name and the editor field contains their biog.
I need to display wording saying 'Sorry but [wpv-post-title] has not entered any personal details yet!' if there is no content in the editor field.
I have tried:
[wpv-conditional if="( $(wpv-post-body) eq '' )"]Sorry but [wpv-post-title] has not entered any personal details yet![wpv-post-body view_template='None'][/wpv-conditional]
But this displays the message on all members pages and does not differentiate between and empty Editor field.
The wpv-post-body shortcode isn't available in the dropdown of Views shortcodes when using the conditional output button on the editor to insert the conditional shortcode.
That shortcode has a special purpose in Views, because it doesn't just output the post body, but is used to determine the Content Template used when outputting a post.