It has been the bane of my development with DatoCMS. How does one create breadcrumbs dynamically? Assuming that there are no hard coded pages, everything is in one content type called Pages, how does one query or generate the breadcrumbs? Take note also that it can be 2-3 levels deep.
Preview Links: I have been following this plugin and Im getting an error: Failed to load resource: the server responded with a status of 401 (Unauthorized). Am I missing somethign?
For #1, it depends on your frontend routing setup. If all the pages are in one flat folder, can’t you just their slug for the URL? If they are nested inside each other, perhaps a plugin like https://www.datocms.com/marketplace/plugins/i/datocms-plugin-tree-like-slugs?s=slug could help? If I’m misunderstanding, could you please provide an example content hierarchy and how you want the breadcrumbs to look?
For #2: It’s a bit complicated to setup (sorry), but did you do all the steps in the readme (e.g. set up the webhooks on the Next endpoint, with proper env vars there etc.?) It looks like something is missing an auth header (your API key), probably, but hard to say without more detailed logging? Can you please more details and/or screenshots or a recording, but with the auth keys blurred out?
Thank you for your reply. Please see my responses below:
That is exactly what I am looking for. Thank you for the recommendation for the plugin. Devs can then query it from the slug/url and create the necessary breadcrumbs.
EDIT: I just realised that the child pages must be defined in the nav tree. What if the child page is not defined in the nav tree?
EDIT: I figured it out. The Preview Webhook URL didnt have the token query parameter. I think that was missing from the documentation (or I might have missed it)