Add queryparam (URL Param) based on the URL of the Page (HubDB Filter)

SOLVE
Highlighted
Occasional Contributor | Gold Partner

Hey!

 

I have a problem and im trying to figure out the following:

 

If a acess a site where the URL contains /de i want to add a query params (via HubL).

 

So for example, if i access: www.test.ch nothing should happen it should stay www.test.ch

 

But if i access www.test.ch/de than the follwoing should happen: via HubL the queryparam ?standort=4 should be added.

 

So if i acces www.test.ch/de the url should be manipulated (via HubL) to 

www.test.ch/de?standort=4

 

The param standort=4 applies a filter for the HubDB. So this could be seen as a default Filter when accessing a page with /de in the URL.

Reply
0 Upvotes
1 Accepted solution

Accepted Solutions
Highlighted
Solution
HubSpot Moderator

Hi, 

 

I posted a reply to another question a couple years back that might be helpful. The question was how to paginate data with a query param. There are two solutions and one is with a query params for the paginated data from HubDB. You should be able to apply the same concept from the paginated data to help add a query param for your HubDB query. 

 

https://community.hubspot.com/t5/CMS-Development/Pagination-for-table-rows-of-hubDB/td-p/25343

 

Let me know if this post helps out. 

View solution in original post

1 Reply 1
Highlighted
Solution
HubSpot Moderator

Hi, 

 

I posted a reply to another question a couple years back that might be helpful. The question was how to paginate data with a query param. There are two solutions and one is with a query params for the paginated data from HubDB. You should be able to apply the same concept from the paginated data to help add a query param for your HubDB query. 

 

https://community.hubspot.com/t5/CMS-Development/Pagination-for-table-rows-of-hubDB/td-p/25343

 

Let me know if this post helps out. 

View solution in original post