Skip Navigation

[Resolved] Display a url parameter value in content template

This support ticket is created 5 years, 1 month 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 Waqar 5 years, 1 month ago.

Assisted by: Waqar.

Author
Posts
#1217991

Lee
Sketch.jpg

Hi,

I am using various views throughout my site to display relevant content based on url parameters passed from the previous pages view. I have no problems with this and everything is working great.

I would like to know if it's possible to display data contained within the query string in my content template?

So as an example:

A 'home' has multiple 'locations' assigned (France, Spain, Italy)
The user filters the view and selects only 'homes' available in France.
When the user selects a 'home' from the view on this page, I want to be able to include in the url the chosen 'location' (France)

That way when the user clicks through into the selected 'home', the view on this page is already filtered by the 'location' chosen on the previous page.

I can't use the shortcode for the 'location' category, because each home has multiple 'locations' assigned.

I have attached a sketch to hopefully help clarify what i'm saying.

Thanks
James

#1219640

Lee

Thanks Waqar, this worked a treat.

Now on to the next step, how can this be used in a conditional output?
Will I also have to create a custom function?

Thanks
James

#1219715

Waqar
Supporter

Languages: English (English )

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

Hi James,

Thanks for the update and glad it worked.

You can use the values returned by the shortcodes directly into the conditional block comparisons and won't have to write separate custom functions for that.

For more details on the topic, please visit:
https://toolset.com/documentation/user-guides/conditional-html-output-in-views/using-shortcodes-in-conditions/

regards,
Waqar

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