Dynamic Params Matching? #10690
Replies: 2 comments
-
I think you would need to use a single route instead of the 3 separate routes for industry, category, subcategory and within the load function you do the database query to differentiate between industry, category, subcategory. Then in the +page.svelte page you would conditionally render the correct page component which you store in separate .svlete files: IndustryPage.svelte, CategoryPage.svelte, SubcategoryPage.svelte. It seems kind of hacky, but that is the only way I can think of accessing the database to determine what to load and which page to use for the route. |
Beta Was this translation helpful? Give feedback.
-
Not a big fan of having everything branch from single +page.svelte and +page.server.ts as it becomes a bit unorganised and harder to change things. I think I'm going to try some sort of interval request within each of these param files to update the validity. Keep you guys posted ot see if it works |
Beta Was this translation helpful? Give feedback.
-
Challenge I have:-
SEO guy wants
With reference to https://kit.svelte.dev/docs/advanced-routing I went with "params" and have a structure as follows because each of these have different datasets and layouts
however I soon realised that they all need to be generated during compile time and params are fixed without the ability to update...
My question... Is there a way to dynamically update the params matcher when I add entries to the database?
we may want to add more categories / subcategories / events
Beta Was this translation helpful? Give feedback.
All reactions