Dieser Thread wurde gelöst. Hier ist eine Beschreibung des Problems und der Lösung.
Problem:
How to conditionally display Elementor modules?
Solution:
That is not currently supported, but you can conditionally display content based upon field values using the wpv-conditional shortcode, as described in the documentation below.
The Elementor UI doesn't allow inserting such shortcodes, it will be necessary to copy and paste into the Elementor template or manually write the shortcode.
This support ticket is created vor 6 Jahren, 3 Monaten. 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.
Heute stehen keine Supporter zur Arbeit im Werkzeugsatz-Forum zur Verfügung. Sie können gern Tickets erstellen, die wir bearbeiten werden, sobald wir online sind. Vielen Dank für Ihr Verständnis.
i've added a custom field to posts via Toolset. In this custom field you can now upload a PDF.
In the respective elementor template for single posts, I have now created a download button and connected this via dynamic content with the custom field created in Toolset. But this download button now appears in every post - regardless of whether a PDF was selected in the backend or not.
How can I set it up that this download button is only displayed in posts when a PDF was linked in the backend?
So try creating a Views Content Template (rather than an Elementor template) to do this first.
Once you have it working, copy and paste the markup (with your types field shortcode wrapped in wpv-conditional shortcodes) into an html module in your Elementor template.
You won't be able to use the button module with dynamic content, you'll have to add the markup to display your PDF link as a button yourself.
There's one way to do some conditionals in elementor, but I'm not sure if it'll work in this case.
in elementor when you set the dynamic content to a toolset item there is a fallback field for when it doesn't find data, in there you can add html, use some styling to hide the item that you don't want to show. It's not the best solution, but it works. Here's an example where i used it.
CPT that has multiple text fields. I have template that displays that CPT. Each of those text fields has a Title block in elementor preceding it. Some of the text fields don't get used, so it would show the title, with no content under it on display.
I just added .title-people in the class field on the elementor item that will need to be hidden when there is no content for the section. (make sure it's unique or you will hide all the items using that class)
Then on the elementor item that is calling the toolset items dynamically, in the fallback field I put this: