Skip Navigation

[Resolved] How to hide Elementor button with empty Toolset "File" field

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

Last updated by Shane 4 years, 11 months ago.

Assisted by: Shane.

Author
Posts
#1537267

Tell us what you are trying to do?
I have Elementor template combining a few views and elementor elements with dynamic Toolset fields.

One of the elements is a button with link to PDF brochure, link is custom "File" field in one of my custom post types (Products is the name of custom post type).
The button works, but not all Products have PDF brochures. I would like to completely hide the button, if the "FIle" field is empty.

How can I do that?

What is the link to your site?
hidden link
locked password: factory

#1537685

Shane
Supporter

Languages: English (English )

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

Hi David,

Thank you for getting in touch.

If you are using the elementor dynamic field option to display the PDF information the frontend on the frontend then we are not able to hide this.

It is possible to do if you're displaying using the shortcode from our Plugin not if the information is displayed with elementor.

You will need to contact the elementor team in order to see if they have a solution for when the fields are empty.

Thanks,
Shane

#1537711

Can I create a View in Toolset that has custom field link (to then create a button) from current post? The I can embed the shortcode of this view in Elementor.

#1537833

Shane
Supporter

Languages: English (English )

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

Hi David,

Not sure why you would want to create a view to display the data when you can display it directly with the types shortcode on your page template.

You can use the types shortcode to add the field to the page rather than creating a view.

An example would be
[types field='field-slug'][/types]

If you replace field-slug with the slug of your url field then you should be able to retrieve the value like that.

Thanks,
Shane

#1537883

Hello, I can't hide empty field inside Elementor.
If I can create a view with link/button, it is possible to not show empty field, thus hiding button if there is no link in custom field. Then Elementor would not show it. Am I correct?

#1537889

Shane
Supporter

Languages: English (English )

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

Hi David,

I'm not 100% sure what you mean. Could you send a screenshot of the area that you want to hide the field ?

I know that anything that has to be done with hiding any elementor element will need to be done using elementor but please provide a screenshot for clarity.

Thanks,
Shane

#1537929
Screenshot 2020-03-03 at 22.25.16 .png

OK, so I have a custom post type called Products. It has several custom fields, one of them is called "Brochure", which is a file field type. We upload a pdf document and paste a link to this Brochure field.
In elementor I created a button with a link to this brochure. The problem is not all products have brochures, so I would like to hide this button, when the Brochure field is empty. Elementor can't do that.

On the same page I also have several repeatable fields that display icons of product features. These repeatable fields are built with views (for every group of icons there is a separate view) and inserted in Elementor with Toolset View element. These Views of icons are configured so when there are no icons, views are not displayed. This works.

Now, is it possible to create this brochure button using Views and then insert it to Elementor using Views element or shortcode? So Views will control display of the button and if the field is empty, the button will not be displayed.

#1539009

Shane
Supporter

Languages: English (English )

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

Hi David,

So what you would need to do at this point is use our Types shortcode. Given that the information is on the page you can use our conditional code like this.

[wpv-conditional if="( '[types field='my-url-field'][/types]' ne '')"] Button code goes here [/wpv-conditional]

You are going to create the button manually in order for this to work.

Thanks,
Shane