Join the Webstudio community

Updated 3 months ago

Displaying Blank Information for Random Slugs

At a glance

The community member is having an issue with their dynamic pages not loading if the slug is not one of their entries in Hygraph. They tried using a template from Hygraph, but it still displays blank information for random slugs instead of a 404 error. The community members in the comments suggest that the issue can be resolved by rendering the content based on the response data or status code, such as displaying nothing if the status code is not 200. The community member indicates that this solution worked for them.

Useful resources
Hello guys, for one of my dynamic pages, I don't want it to load (404) if the slug isn't one of my entries in hygraph. The problem is that it's still just showing template page without the variables filled in. I also tried to use to template for hypgrah: https://p-d606d380-194b-4824-ac13-14250cebb67d.apps.webstudio.is/?pageId=1jkglW2FnGk1q4oJlNucg&authToken=db9b93db-6c30-40d2-886e-c61dcfe8bc2e, but even the template you guys made has problems with displaying blank information for a random slug instead of just saying 404 and displaying nothing. Am I missing something?
O
b
5 comments
You can render what you need depending on the response data or status code
sorry not following, how could I do that?
oh as in display nothing if the status code isn't 200 or something?
Or bind any other message
great! it's working now, thanks!
Add a reply
Sign up and join the conversation on Discord