Skip Navigation

[Resolved] Conditional display of Types custom fields

This thread is resolved. Here is a description of the problem and solution.

Problem:

The issue here is that the user wanted to check if a field is empty.

Solution:

You can actually use our views conditional shortcode to achieve this.

https://toolset.com/documentation/user-guides/conditional-html-output-in-views/checking-fields-and-other-elements-for-emptynon-empty-values/

This support ticket is created 6 years, 4 months ago. There's a good chance that you are reading advice that it now obsolete.

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 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

Tagged: 

This topic contains 1 reply, has 2 voices.

Last updated by Shane 6 years, 4 months ago.

Assisted by: Shane.

Author
Posts
#923489

Hi there,

I hope you can help me with this problem.

I am using Elementor to create the layout of a site, with Astra Pro theme as the basis. I have used Types to create a custom post type and custom fields so that members can enter information onto their profile pages.

I know that as yet there is no direct integration between Elementor and Toolset.

I can however display the content of custom fields in the Elementor editor by using the field shortcode. So for example, the languages field I can display by entering the following shortcode inside the Elementor editor:

[types field='afepi-languages'][/types]

However, the only I have is that we need to only display each field on a member's profile IF that field has been completed by the member. Not all fields will be completed by all members. This is to avoid having blank spaces within member profiles.

So my question is this: is there any way to make the shortcode work for each field, so that it will output the information from a field ONLY IF that field has been completed by the member?

I really hope you can help, this would be a huge thing for me.

Very best wishes, and thanks so much for your time.
Andrew.

#923656

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Andrew,

Thank you for contacting our support forum.

You can actually use our views conditional shortcode to achieve this.

https://toolset.com/documentation/user-guides/conditional-html-output-in-views/checking-fields-and-other-elements-for-emptynon-empty-values/

Please let me know if this helps.
Thanks,
Shane