Skip Navigation

[Resolved] Elementor – nor url – but using buttom field for link to facebook, twitter, web

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

Problem: I would like to display a button in an Elementor template if a custom field contains data.

Solution: Use a text element and conditional HTML to include an external Elementor template.

Relevant Documentation:
https://toolset.com/documentation/user-guides/conditional-html-output-in-views/

This support ticket is created 5 years, 9 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
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

Tagged: 

This topic contains 2 replies, has 2 voices.

Last updated by mindyB 5 years, 9 months ago.

Assisted by: Christian Cox.

Author
Posts
#1236620

Tell us what you are trying to do?

In elementor selected the button type (as no visible url widget), then selected dynamic and linked to custom field. Works great when there is data. But if one of our listings has not data in field selected, the button is not hidden but present. Suggestion?

has facebook button, but no data - so button not hidden - what to do???????
hidden link

(This one has data and works fine:
hidden link )

#1236680

In a Toolset template, you can use conditional HTML to test the value of a custom field. If it's empty, then you can skip the button. If it's populated, then you can show the button.
https://toolset.com/documentation/user-guides/conditional-html-output-in-views/
You can use the same conditional HTML code in an Elementor text element. So maybe if you split the button into a separate template, you could include that Elementor template in your conditional HTML using a shortcode...I'm not an Elementor expert so I can't say for sure. I don't think they offer an element that provides conditional logic.

#1237431

My issue is resolved now. Thank you!