Hello,
I am using nested-docs plugin to create breadcrumbs. 4 different collection use nested-docs but when I select parent page from one collection to another, the plugin doesn't create breadcrumbs correctly. It doesn't care parent page but I select parent page in same collection then the plugin is successful to create breadcrumbs correctly.
What is the problem here?
Here is my setup:
nestedDocs({
collections: [Page.slug, Post.slug, EnBlog.slug, TrBlog.slug],
parentFieldSlug: 'parent',
breadcrumbsFieldSlug: 'breadcrumbs',
generateLabel: (_, page) => (page.name as string) || '',
generateURL: (pages) =>
pages.reduce((url, page) =>
${url}/${page.slug}
, '')
})
If I choose a parent from page collection to page collection, plugin works correct but If I choose a parent from post collection to page collection then plugin can not generate parent page breadcrumbs.
Hmm good question Mumin, I think
@808734492645785600can help with this one as they most recently updated that repo
any idea?
Interesting, the plugin was never designed to work across multiple collections like that. I'm not sure we'd ever be able to create hierarchy in this way without some rethinking how we traverse documents up the tree.
I don't know you have plan to integrate this but I created an issue for that anyway.
https://github.com/payloadcms/plugin-nested-docs/issues/19Star
Discord
online
Get dedicated engineering support directly from the Payload team.