patronage / bubs-next

Headless Wordpress + Next.js Project scaffolding
https://bubs-next.vercel.app
MIT License
37 stars 10 forks source link

Custom Post Type Routing #72

Closed ccorda closed 2 years ago

ccorda commented 3 years ago

Ideally, we'd make it easy to support a "simple" custom post type, with the following requirements:

And a more complex version that also adds:

It'd be nice to have separate components for index/single displays.

The actual graphql that calls should be easy to adjust as different post types might have different requirements.

We need to make sure that these routes support query strings, either from cache posting via WordPress, or things like UTM params.

Something we should look at is the <NextTemplateLoader> from the new wpengine headless framework: https://github.com/wpengine/headless-framework/tree/canary/docs/templating

kylehotchkiss commented 2 years ago

https://www.wpgraphql.com/2021/12/23/query-any-page-by-its-path-using-wpgraphql/

NodeByUri might solve this

ccorda commented 2 years ago

Dupe of #133