2.4 Integrated Relations

Integrated allows (admin) users to add relations. A relation can be used to define the relationship between content types, e.g. adding keywords to an article.

Defining a relation

To define a relation start with the Manage - Relations menu item. A relation can be defined with:

Name Name to be used when editing content.
Type Type of the relation (see next paragraph)
Sources Content types which are allowed to use the relation. This are the content types which will have a new field for the relation, to choose the linked items.
Targets Content types that are allowed to be linked.
Multiple Tells if multiple linked items are allowed for this relation. This is a validation when editing content only, relations are stored in the same way in both situations.
Required Tells if it is required to have a minimum of one link on this relation, when editing an item from the source content types

When adding a relation allowing to add keywords to an article, the Article content type will be the source and the Keyword content type will be the target. This means the Article content type will have a new field for choosing keywords.

Relation types

A relation always has a "type". The type tells about the kind of relation. Integrated offers some build in types:

embedded Used to link items that should be embedded in the content item. Useful for images, media, etc.
taxonomy Used to link items that tell about the taxonomy of the content, for example Keywords.
commercial Used to link commercial information to the content item, such as "Payed listing".

Other types can be added by any bundle.

Using relations in code

When using relations in code, it is best practice to find linked items by relation type instead of queries on the specific relation. By using the type, the (admin) user keeps the possibility to change relations, without the need to change the code. For further reference see the Use relations in code documentation.