Skip Navigation

[Resolved] conditional display based on url parameter

This support ticket is created 2 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 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 2 replies, has 2 voices.

Last updated by yosukeS 2 years, 11 months ago.

Assisted by: Waqar.

Author
Posts
#2026875

Tell us what you are trying to do?

I am trying to display a form ONLY WHEN url contains certain parameter such as &step=2
how do i do it?

Is there any documentation that you are following?
https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#wpv-conditional

What is the link to your site?
hidden link

#2026993

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi,

Thank you for contacting us and I'd be happy to assist.

To show the form, only when a specific URL parameter value is available in the URL, you can use the conditional shortcode along with the "wpv-search-term" shortcode:
https://toolset.com/documentation/legacy-features/views-plugin/using-shortcodes-in-conditions/
https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#wpv-search-term

Example:


[wpv-conditional if="( '[wpv-search-term param="step"]' eq '2' )"] 
[cred_form form="form-to-add-new-post"]
[/wpv-conditional]

This will show the form with slug "form-to-add-new-post", only when "step=2" is set in the URL.

regards,
Waqar

#2027959

Thank you Wagar!
I thought the same code but somehow mine wasn't working. Your precise explanation and clear direction helped me to solve my issue.

Thank you so much!

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