#Advice on Structuring Collections for a Website Using the Payload Website Template

10 messages · Page 1 of 1 (latest)

silver bone
#

Hi everyone,

I’m working on a website using the latest version of Payload CMS with its default website template. The project requires several structured collections with both listing and detail pages. Here’s the structure:

  • Sectors: Title, description, image.
  • Capabilities: Title, description, image.
  • Perspectives: Title, description, image, sectors, capabilities, people involved.
  • Projects: Title, description, image, location, sectors, capabilities, people involved.
  • People: Title, description, image, position, location, member type, linked capabilities, projects, perspectives.
  • News: Title, description, image, location, sectors, capabilities, people involved.

The homepage will dynamically feature content from most of these collections.

My Plan

I’m considering creating individual collections for each of these entities to simplify relationships and keep the admin interface clean. I’ll then use blocks for flexibility in page layouts (e.g., the homepage).

However, I noticed the template’s default Posts collection is designed to cater to diverse design use cases. Should I instead repurpose Posts (e.g., for News or other entities), or is it better to create standalone collections for everything?

I’d love to hear your thoughts on the best approach and whether my plan aligns with Payload’s recommended practices.

Thanks in advance!

civic folioBOT
winged cliff
#

Hey @silver bone,

My honest opinion here is to create those collections instead of repurposing the existing posts collection. The reasoning being is that it's easier to think through your data model without having to first worry about refactoring existing code. That can be a secondary concern while you build out your application. In this way, you can build out your data model as you'd expect, and then refactor out posts or vice-versa. Seems simpler to me, personally, and keeps these tasks separate and easier to track.

silver bone
#

Thanks @winged cliff for your prompt advice.

winged cliff
#

This is actually what I typically do on the occasion that I'm using the website template.

#

It's my pleasure

silver bone
#

Any tips on how to remove Posts and Categories then?

#

Just removing them from payload.confg result in errors.

winged cliff
#

Right, because by default you have dependence on these collections from a few locations in the application. So for example, in your Blocks like Archive, in (frontend), in components

#

If it seems like a burden, it might even be advisable to start with a blank template, and then copy over the stuff you do actually need since most of the important stuff is defined in config anyway, it's easy to copy + paste