Skip Navigation

[Resolved] Add a dynamic ID to a URL

This support ticket is created 2 years, 7 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.

This topic contains 2 replies, has 2 voices.

Last updated by Marcel 2 years, 7 months ago.

Author
Posts
#2362537

This is a follow up question for this topic: https://toolset.com/forums/topic/how-to-display-dynamic-content-on-pages-based-on-a-selection-on-the-landing-page/

In that topic, we added a post ID as a dynamic parameter to the URL. Now, I would like to add that parameter on a button.

So for example, the URL of a page is xxx.com/?contact_id=1462. Now, I have a contact button on that page, that should point to xxx.com/contact/?contact_id=1462.

So I need to capture the parameter and add that to the button's URL.

#2362709

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

If you are able to edit the button markup directly (rather than inserting a button via a block or page builder, for example) then you can output the value from a url parameter using the wpv-search-term shortcode, specifying what the parameter is, e.g.

[wpv-search-term param='contact_id']

You could use that when constructing the href attribute of the button.

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

#2365273

What a clever solution, that works fine 🙂 Thanks!