Skip Navigation

[Resolved] How to use a condition an a select field to create a shortcode

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
- - 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 reply, has 2 voices.

Last updated by Beda 4 years, 11 months ago.

Assisted by: Beda.

Author
Posts
#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