Finsweet hacks need some help please

Hi, I am trying to follow this Finsweet hack. I have very basic knowledge of this and would be grateful to anyone who knows how to tweak these things.

Dynamically change the content of a landing page based on the URL parameter:

I have included the adjusted hack script that I am using. However, when I run it, it returns the URL as:
https://MYSITE.webflow.io/search-results-page?search=car
Which is very close to what I want. The “search” before the =car is the Field Name. However, I need the URL to turn into:
https://MYSITE.webflow.io/search-results-page?*=car

SO, INSTEAD OF “SEARCH” I need a “" sign in there and it would work. I cannot change the Field Name to "” as its not allowed. Does anyone know a way around this PLEASE?

<!-- F’in sweet Webflow Hacks -->
<script>
// if the page url has a query string
if(window.location.search){
  // get all url search params from the query string
  const urlParams = new URLSearchParams(window.location.search);
  // get the value of the 'Search' search param
  // and set it as the .filter_search-field text
  $('.filter_search-field').text(urlParams.get('Search'));
}
</script>

Hi Ryan,

Need a bit more context on this so that I can suggest the right approach. Why are you trying to do this? What’s picking it up?

Are you trying to use FS Filter in conjunction with this and have a text filter set to all text fields? I’m making wild guesses here at what you’re trying to accomplish.

Please share a demo and readonly designer link of what you’re building also, or a prototype that exhibits the same design problem.

1 Like

Hi Michael, I am going to PM you my staging site so that you can see it. I didn’t want to make things public yet. Anyway, I have search bar on my home page. It’s the expanding/collapsing search bar I got from Nelson’s Pixelgeek videos. Anyway, I have a seperate page “search-results-page” which has the Finsweet search and filter enabled and working (which I got done following some of your advice). Now, I would like to avoid paying for Jetboost (early stage and pennies count), so I have been able to set up the search bar to work and redirect to the search-results-page following the Quary Param guides. However, the URL string needs to have a “*” (star) in it to work (as described in my OP) but I can’t figure out a way to do it.

One day I have to make time to learn to code so that I wouldn’t need to ask for hellp on things like this!

I’m still not clear on where you’re running into problems with the * key in your querystring. It’s unconventional, but technically supported. I remember building something around this for a German client but I can’t remember the solution I went with for their situation.

Yes, generally cheaper than hiring someone :laughing: but if you need help, I have a special micro-consulting rate and can dig into your project and build this piece out .

If you can describe your prompt correctly to chat gpt you should be able to get a good solution on this as well, you just have to be clear about when you’re setting the querystring and what you need. If you can’t do the * as a key in URLSearchParams, you should still be able to set the fully querystring directly to initialize FS Filter the way you want to.

1 Like