Skip Navigation

[Resolved] Trouble with condition logic for images in Divi

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

Problem:

I am using Toolset and Divi. I am trying to show a row of social media icons with links drawn from Toolset custom fields. I only want to show social media icons that have the corresponding custom field in non-empty.

Solution:

In Toolset side, if the custom field is created with Toolset Types plugin, Types plugin will add prefix "wpcf-" before the field slug, for example, your custom field slug is "my-facebook" in Toolset setting, then in database, the field slug is actually "wpcf-my-facebook".

Relevant Documentation:

https://toolset.com/documentation/customizing-sites-using-php/functions/

This support ticket is created 2 years, 8 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 – 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 8 replies, has 2 voices.

Last updated by WilliamM1564 2 years, 8 months ago.

Assisted by: Luo Yang.

Author
Posts
#2315629
William_Galileo___Rockstar_Psychics.jpg
Theme_Builder_‹_Rockstar_Psychics_—_WordPress.jpg

Tell us what you are trying to do?
I am using Toolset and Divi. I am trying to show a row of social media icons with links drawn from Toolset custom fields. I only want to show social media icons that have the corresponding custom field in non-empty.

In Divi I have been successful in drawing the link for the image from the Toolset custom field. However, although Divi has conditional logic for displaying images (e.g. display only if a specific field is non-empty) I cannot access the Toolset custom fields in the Conditional logic panel.

This is a significant shortfall of the Divi / Toolset integration. I asked Divi support about it and they suggested I reach out to you.

Is there a way to get the Divi conditional logic panel to refer to the Toolset custom field?

Is there any documentation that you are following?
No.

Is there a similar example that we can see?
It would look like the attached image except the icons without links would not be displayed.

What is the link to your site?
hidden link

#2316079

Hello,

This should be same issue as your another thread:
https://toolset.com/forums/topic/trying-to-produce-a-row-of-social-media-icons-for-in-custom-post-divi/

Please check the answer in above ticket.

#2316893

No my question here is different. It seems that the Divi integration is not complete. I cannot access the Toolset custom fields within Divi's image module's conditional display panel.

Why is that?

#2316975

I assume we are talking about "The New Divi Condition Options":
hidden link

If it is, please check above Divi document, it does not support to use custom fields as condition, you should be able to find similar comments in above document.

If their feature supports custom fields, it should be able to support Toolset custom fields too.

#2317005

It does support custom fields, just not Toolset custom fields.

Elegant Themes support said they cannot access the fields there due to a limitation in the plugin over which they have no control.

Oddly, I am able to see Toolset custom fields where I set the URL in the image (see the screenshot attached above).

#2318029

Since I can login into your website, please point out the problem page URL, where and how can I see the problem you mentioned above:

although Divi has conditional logic for displaying images (e.g. display only if a specific field is non-empty) I cannot access the Toolset custom fields in the Conditional logic panel.

#2318117

It's not really a URL, this is the Divi template for the Advisor custom post type. It's the equivalent to the Toolset Content template (I think).

I have created a Loom video showing you how to get there see the problem in action.

hidden link

#2319131

Thanks for the video, in your video, time 3:42, there is an option "Manual Custom Field Name", it seems that Divi allow you input the field slug manually.

In Toolset side, if the custom field is created with Toolset Types plugin, Types plugin will add prefix "wpcf-" before the field slug, for example, your custom field slug is "my-facebook" in Toolset setting, then in database, the field slug is actually "wpcf-my-facebook".

Can you try it with option "Manual Custom Field Name"?
https://toolset.com/documentation/customizing-sites-using-php/functions/

However, when you are accessing custom fields through native WordPress functions, you need to prepend the wpcf- prefix to the slug. Continuing from the above example, for native WordPress function to access the “House Price” field, you need to use the wpcf-house-price slug.

#2320135

In the end, manually typing in the slug with the "wpcf-" prefix worked. I had tried the field name but I hadn't thought to use the slug.

My issue is resolved now. Thank you!