Like what we’re doing? Star us on GitHub!

How to organize data for pages with different designs?

7 months ago
1 1

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:

  1. Have a separate collection for each page.
  2. Have a single Pages collection. In this case, I don't see how each page would have different fields.
  3. Use the Global and specify each page as an object inside. That just sounds wrong.

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?

  • DanRibbens
    Payload Team
    7 months ago

    Great question! I would head on over to the 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

    Does that help?

    2 replies
  • DanRibbens
    Payload Team
    7 months ago

    You could also consider making a field in the pages collection called design as a select or radio type. Then use the conditional properties so that your design specific fields are only used when needed.
    That would be a good approach if you don't want to give as much editor control as the public-demo has.

  • hdodov
    7 months ago

    Sounds great, thanks!

Open the post
Continue the discussion in GitHub
Can't find what you're looking for?
Get help straight from the Payload team with an Enterprise License.Learn More