How to organize data for pages with different designs? #832
-
If I'm making a blog, it's obvious that I need a Post collection, where each document represents a single article. But what if I'm making a general-purpose marketing site where I have a few different pages that all have different designs and therefore need different fields for content? These solutions pop in my mind:
The first approach seems the most rational, but what bothers me is that I'd have a collection with just a single document inside. Kind of like the Global collection. Does that make sense? Or there's a better way? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Great question! I would head on over to the demo.payloadcms.com example and see if that accomplishes what you want. On the pages collection there is a design templating approach that is very flexible by giving content authors a choice of different layouts and using content blocks to make pages that are very composable. All the source code for the project is available too so take what you like and delete or modify the rest. It is found at https://gitbub.com/payloadcms/public-demo Does that help? |
Beta Was this translation helpful? Give feedback.
Great question! I would head on over to the demo.payloadcms.com example and see if that accomplishes what you want. On the pages collection there is a design templating approach that is very flexible by giving content authors a choice of different layouts and using content blocks to make pages that are very composable.
All the source code for the project is available too so take what you like and delete or modify the rest. It is found at https://gitbub.com/payloadcms/public-demo
Does that help?