Written by The Jahia Team
   Estimated reading time:

Abstract Type

Mixins are abstract data types that are usually packaged with a set of related properties and/or child node definition.

Occasionally, mixins are used as flags rather than property packages.

Example of a mixin declaration:

[mymix:ranking] mixin
 - rank (long)

Example of using a mixin as part of a component definition:

[jnt:content-type] > jnt:content, mixin1, mixin2

Due to the inheritance mechanism, parent properties can be retrieved as well.

Only a single parent node type is allowed, but several parent mixins can be set.

How NodeTypes become Components

To make the node type available for editors, a mixin must be selected from the following list:


By applying one of theses mixins, a node type will appear in the components list in the Editor interface. This is also how component categories are added:

[mymix:myContent] > jmix:droppableContent mixin

Example of adding this new mixin to a component

<jnt = 'http://www.jahia.org/jahia/nt/1.0'>
<jmix = 'http://www.jahia.org/jahia/mix/1.0'>
<acme = 'http://www.acme.com/jahia/nt/1.0'>
<acmemix = 'http://www.acme.com/jahia/mix/1.0'>

[acmemix:acmeComponent] > jmix:droppableContent mixin

[acme:newsItem] > jnt:content, acme:acmeComponent 
- title (string) i18n
- body (string, richtext) i18n
- date (date)
- breakingNews (boolean)

Creating a Mixin Node Type

  1. Under definitions.cnd the "New node type definition" option is selected.
  2. ”Mixin node type” is selected from the resulting pop-up window.


Refer below for an example of creating the mixin type called "My Content Category". Note that it inherits from the mixin jmix:droppableContent.


Using mix:title

The predefined mixin mix:title is used to define a standardized title, on which the system name is synchronized:

[mix:title]  mixin  
        - jcr:title (string) i18n boost=2.0

This mixin can be used on any content type.

Note, the following content type has two properties: one is jcr:title, and the other one is text.

[mynt:myComponent] > jnt:content, mynt:myCategory, mix:title
        - text (string, richtext)

If the default inherited property configuration does not fit the component requirements, then it can be overridden:

[mynt:myComponent] > jnt:content, mynt:myCategory, mix:title
        - jcr:title (string) primary
        - text (string, richtext) i18n

Note that this content type has only one jcr:title property, which is not internationalized due to being overriden.

Academy Document: Content Types

Further reading on Components and Content Types:

Creating a Content Type

Exercise: Create a new mixin for 'Component Category'

  1. Add a property 'Badge Number', of type string, to the employee component.
    • Synchronize the system name with this property.
  2. Add a property to the employee component called “biography” of type string.
  3. Create a custom component category for components created in the AcmeCompany Module.  
  4. Switch the Employee component from the category “Content: structured” to this custom component category.