Skip Navigation

[Resolved] Dynamic Labels on Upload Forms

This support ticket is created 3 years, 6 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)

This topic contains 1 reply, has 2 voices.

Last updated by Christian Cox 3 years, 6 months ago.

Assisted by: Christian Cox.

Author
Posts
#2035769

I was just wondering if there's any easy/built in way to dynamically have the labels on an upload form. Right now it's one form with very similar content but a few key differences. Rather than making two separate forms, just wondering if there's an easy way to have the static text change based on parameters in the url?

I could do it all with custom JS but realistically probably easier to simply duplicate the form but let me know if there's anything I'm missing.

#2035989

Hello, if I understand correctly, you want to display different label text in a Form based on some URL parameters. There is nothing built-in to the drag-and-drop Form builder that would help you set up this type of dynamic label, but if you use the advanced editor you can implement conditional shortcodes that test the value of any URL parameter with the Views shortcode wpv-search-term, for example:

[wpv-conditional if="( '[wpv-search-term param="your-param"]' eq '123' )"]
<label>Text if your-param equals 123</label>
[/wpv-conditional]

[wpv-conditional if="( '[wpv-search-term param="your-param"]' ne '123' )"]
<label>Text if your-param does not equal 123</label>
[/wpv-conditional]

You would replace your-param with the URL parameter you want to test, and replace 123 with whatever value you want to evaluate, or a blank string would test if the parameter is empty.

https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#wpv-search-term

Let me know if I've misunderstood the requirements here.