Content – entities and components

Entity

The main content you manage with Dossier is entities. An entity has a unique id, so it can be referenced from other entities, and a unique name, which makes it easier to distinguish from other entities. An entity has named fields containing the actual content. Changes to an entity creates a new version so you can always go back in time to look at when changes were made and what changed.

An example of an entity is this article, it has the following properties:

  • an id (6384629e-72aa-482c-b070-bc26d90e0fc6)
  • a name ("Content – entities and components")
  • a title field with "Content – entities and components"
  • a slug field with "content" (the slug is used to create the URL for this page)
  • a body field with the text you're reading now

Each entity has an entity type that defines the structure of the entity and its fields. That means that all entities of the same type will have the same fields. This article has the entity type "Article".

You can check out this article in the Playground:

 

This article in the playground

Publishing and entity status

In addition to creating and changing the content of entities, you can also perform a number of publishing actions on an entity. Each action modifies the status of the entity. These are the actions that are available:

  • A newly created entity has the status draft
  • Publish a version of an entity to make it available. The status will be published, or modified if there are newer versions of the entity that haven't been published
  • Unpublish to withdraw a published entity. The status will be withdrawn
  • Archive to show that the entity is no longer relevant. The status will be archived
  • Unarchive to start using the entity again. The status will be draft, or withdrawn if it has been previously published

As of now you can't delete an entity which means you will never lose content since old versions are stored forever. The closest to deleting is archiving, so you can ensure you don't accidentally publish it in future.

Component

Similarly to entities, you can also use components for structured data. Components have fields just as entities, but you can't manage components on their own, they need to be part of an entity. A component can also be part of another component, which enables you to create more complex data.

An example of where a component is used is in the menu to the left on this page. The menu is stored in an entity with the entity type "Chapter". In its "items" field there is a component representing this article. The component has the following fields:

  • a title field with "Content" (which is shorter than the article entity's title "Content – entities and components")
  • an article field with a reference to the article entity

Each component has a component type that defines the structure of the component and its fields. The component representing this article in the menu, has the component type "ArticleTocItem".

You can check out the "Main chapter" entity in the Playground:

The main chapter in the Playground