The Magnolia Content Types module is a tool to define the content model in Magnolia.
|See the Content Types module page for more on the module itself.|
Content models are a key consideration for every web and digital experience project you work on. It creates a shared understanding across the domains of a project, from project owners and marketing leads to content creators to developers.
It describes the key types of content in your project, the properties each of those types has and the relationships between the content types.
|Use content types to easily create content apps.|
Rapid development and deployment
Reduce your time to market with Magnolia content types by reducing development time and increasing deployment production.
Once the content apps are in place, editors can start entering content right away. They can do so in parallel with or even before the rest of the project/template development.
Single file configuration
Developers configure all required definitions for a content type in a single YAML file within a light module. The YAML file contains both the content model and the details about where to store the data (
datasource) such as a
datasource: (1) workspace: tourguides namespaces: mt: https://www.magnolia-travel.com/jcr/1.0/mt autoCreate: true model: (2) nodeType: mt:tourGuide properties: - name: birthday (3) type: Date - name: gender - name: shortBio
When you define a content type property, you should avoid using a 2-letter suffix. This is because Magnolia reads the suffix as a language such as
Automatically generated apps
Creating, editing, publishing, managing and deleting content items of a content type works best with a content app. The content types module automatically generates this app for you based on the content type definition. All you have to do is to provide a minimalistic app definition file referencing the content type definition.
!content-type:tourGuide name: tourGuides-app
Use light modules to deploy new content types and apps to your production environment without redeploying a WAR file or restarting Magnolia.
Convention over configuration
The Content Types module facilitates the development process by following the convention over configuration principle.
With minimal configuration, you can achieve excellent results which follow Magnolia’s best practices based on typical use cases. Nevertheless, you can also map highly complex and sophisticated use cases with content types.
With a content type, you can define structured data in a very straightforward way. Such a definition can be kept simple just by configuring a list of plain properties, but it can also go far beyond this:
Define relations between different content models
Link one or more content items of type A to a content item of type B.
|When you need a group of fields more than once in the same model, use submodels. This allows you to define relations to content items which you created before the Content Types module was available.|
Defining a content app has never been quicker than with referencing a content type. You can do it with one line of a YAML file.
Magnolia generates a ready-to-use app with simple or complex form fields depending on the type of the properties of the given content type.
|For more on fields, see form fields.|
|To satisfy any custom requirements of your content editors, the defaults of the generated app can be overridden on different levels.|
Content types and headless projects
Combining Content Types with the Delivery API makes it a perfect match for headless projects.