Skip Navigation

[Gelöst] How to use a condition an a select field to create a shortcode

This support ticket is created vor 4 Jahre, 3 Monate. 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

This topic contains 1 Antwort, has 2 Stimmen.

Last updated by Beda vor 4 Jahre, 3 Monate.

Assisted by: Beda.

Author
Artikel
#1450889

Hi there,

In an old projekt I used a shortcode for a radiobutton to get show an image, like this:

[types field="altersklassen" option="0" state="checked"]<img style="width: 45px; height: 45px;" src="hidden link" alt="G-Jugend Bambinis U7" />[/types]

It works fine!

Now in another case I need to a shortcode asking for the status of a select field to output a Elementor Shortcode.
Is this possible too?

The Elementor Shortcode shows a specific button depending on the value of a select field. How to trigger the select field an the value?

Any suggestions?

All the best from Germany

#1452521

You'd need to listen to the Select Field, in the HTML condition.

[types field='select-field-slug'][/types] outputs the value of the selected option
So all you need to do is check on that value:

[wpv-conditional if="( $(wpcf-select-field-slug) eq '1' )"]YES[/wpv-conditional]

"1" above corresponds to the value saved in the option of the select field

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.