Join the Webstudio community

Updated 2 weeks ago

using URL query params from the slug to use in requests

I have a url https://shieldcoat.wstd.io/university/shieldcoat-quick-dry-roof-coating-how-long-between-coats?v=oJFYhoSwskg

I have a collection that is supposed to pull data from a cloudflare worker I have that strips the v=oJFYhoSwskg to get captions from the id on youtube then return the captions as json so I can add it to my page.

When I use shieldcoat-quick-dry-roof-coating-how-long-between-coats?v=oJFYhoSwskg on the dyanmic slug inside of webstudio it works but when I publish it doesnt work and I get an error on my worker

message:

"Invalid video ID format",
$workers:

{
event:

{
request:

{
url:

"https://youtube-captions.adrian-b0e.workers.dev/does-shieldcoat-thermabond-really-reduce-heat-scientific-proof-of-25-30-energy-savings",
method:

"POST",
path:

"/does-shieldcoat-thermabond-really-reduce-heat-scientific-proof-of-25-30-energy-savings"
}
},

this implies that even though my webpage has the url param webstudio doesnt have that path and it is stripping the url param. Is this correct?

Ideally I want this to be pull server side so that it assists with SEO, I know I can correct this with a client side script.
a
O
2 comments
I figured out I needed to use search for this not params however you cant test inside of webstudio with this method there should be a UI where you can put search fields.
Agree, @Bogdan and I discussed this https://github.com/webstudio-is/webstudio/issues/5127

We need to make this URL Bar available on any pages, not only the once with dynamic path and it should also have query input

As a workaround you can create any link with a query and click it in preview
Add a reply
Sign up and join the conversation on Discord