Managing Content Models | Workflow Best Practice

I’m new to Cockpit CMS and I was wondering if there is any documentation on the best practices for managing content models across multiple environments, i.e.: local, dev, stage, and prod.

In other CMS’s I’ve used this is generally done by using configuration files and git. However, I noticed that /storage/content is included in the .gitignore file which would suggest that this isn’t the preferred method.

My use case is the following:

I have around 1000 editors that just create content, a handful of site administrators that have elevated permissions allowing them to change things like site settings, layouts, etc usually limited to the UI and a core dev team of 5-10 people. In addition, I have multiple environments, dev, staging, qa, perf and prod.

In general, we like to keep the content models in code for the following reasons:

  1. Provides a consistent starting point for new developers spinning up the project locally
  2. Provides consistency across environments
  3. Allows for testing in lower environments before introducing to production
  4. Provides control and a review process of who can create/update content models
  5. Provides a “paper trail”: Because the models our checked into the code base we have a record of who/when the model has been changed as well as what the definition of the model.

Like I said I’m new to CockPit CMS and perhaps there is a better way to manage this that provides all the requirements listed above. The sync add-on looks pretty cool, and I suppose using roles and permissions you could moderate who has access to change the models. Developers could sync with the dev environment locally when before creating new features. Or you could dedicate a Cockpit instance that is only used to manage the models and use that as the source of truth. I don’t know, just brainstorming…

I would love to hear how others are managing this and if anyone else has a similar use case.

Hi :wave:

Cockpit allows multiple ways to handle content models. One way is to put the model files into your git repo and copy them on deployment. The (experienced) problem with this approach is that when multiple devs/content managers start to modify/adjust content models and forget to commit the model files, all changes get lost on the next deployment.

I prefer to use the sync addon for local, dev, staging and prod envs. Decide which env is your single source of truth and sync from or to envs if needed.

1 Like