🔥Urgent: Multipage dynamic content
I don't quite understand how you want to build it
What's the role of supabase
Is there a limited amount of quizes or is there potentially hundreds?
where is the hmtl embed script coming from for each quiz, where its being configured
I have more questions than answers tbh
How are you handling the quizzes? I’m thinking something like formaloo, can you embed your quizzes? Map out the pages you need and then embed the appropriate quiz options on those pages, wouldn’t that work?
@Oleg Isonen sorry for the confusion. Rn there are about 20 quizzes coming from quizgecko.
I need to know this:
To build a dynamic page that references content of an item you clicked before, the video suggests to use a slug (/:slug). But what if I want to go one level deeper.
Like: Item-> dynamic page of item with more items-> dynamic page.
All of those pages are related to each other.
Would that look something like this: /:slug/:slug2??
I hope this helps to understand
Good suggestion with fromaloo! But I’m using quizgecko rn. And yes the quiz is an embed coming from there.
What do you mean with mapping out the pages?
Maybe this helps to understand the underlying problem:
I have a dynamic collection of links. Those link to another dynamic collection of links. Those link to a page with a dynamic HTML embed.
First step is clear. How do I go from the second dynamic collection to the dynamic HTML ?
You can have as many params as you want
Thanks Oleg, but I’m still not sure how to do it.
Maybe the photo I attached can explain what I want to do.
I forgot to mention, that I have a DB with two tables.
Is there a more efficient way to do this?
I have no idea what I am looking at in that picture, you are gonna have to make it super easy to understand for me.
Based on any amount of parameters you can do different logic, switching out embeds, fetching embed code and binding it into html embed or something
The best way to understand what's going on is to create a simplified test
also why are you having meta tags and what not in the embeds? they are are rendered in the documenet body, these things don't really belong there
As far as I understand you want to learn how to use nested routing
and render depending on the level of nesting different things
I am not sure I can easily explain it to you using your example.
really make a project with a few boxes and just try to render them conditionally, no database , no embeds
also for a collection with a few elements you can get away without a database by simply creating an array variable with a few items in it
maybe @John Siciliano has an idea how to teach this, its a problem with trying to do more advanced stuff without experience
I'll take a stab at it, with the understanding of how to use multiple slugs
- Someone goes to /quiz
2 Between Animals and Cars they select Cars
- That brings them to /category/:maincategory which value would be cars
- Between trucks and SUVs they select trucks
- That brings them to /category/:maincategory/:subcategory with values cars/trucks
- This query would then look for all trucks within cars
Yeah?
But how do I achieve this?
I think he was confirming what you're asking. Then he'll be able to answer.
it would work similar to the tutorials. Instead of querying just for post slug you would have two conditions on the query, not just the one.
So query would be (in english) "give me data where category is cars and subcategory is trucks"
Ahh okay, makes sense. But how would I approach this when I have 2 tables in Supabase (or any other cms)?
Like one table would be /:maincategory with all its data and the other table would be /:subcategory with all its data
you would need to use Joins. The name may vary by platform, but it allows you to join two or more tables together by a property
What´s wrong with this formula?
With this I fetch the data of the subcategory according to the maincategory. But I also get the data of the specific main category
How can I change it, so that I only fetch the data of the categories?
I tried with ChatGPT but it doesn´t work
- It sounds like you are getting the data you need and then some? If so I don't see that as a problem.
- It looks correct in the sense that you are using Webstudio and syntax correctly. If you're not getting the proper data, it's probably because your Supabase query isnt correct so you'd need to refer to the documentation more or wait to see if someone in the community has experience and can help
I think I´m almost where I want to be but I don´t want that maincategory information. I hope this video explains what I mean
Maybe with just small tweaks in the formula it´s removeable?
John!!!! I figured it out!!!!
I´m going crazy xD
btw did you try supabases gql syntax? maybe its better than their query string based
where you can build queries without even typing
Also I really want us to have a UI where you can put query params in individual fields and be able to see results right away on the side, so testing becomes faster
maybe even add a graphiql UI as well, so you can start testing any api without leaving webstudio
Also AI would be a huge help in particular when you provide a URL because it already knows the api potentially if it has public docs
I´ll look into it tomorrow but for now I´m super happy that it works 😄