2.4 Integrated Relations
Integrated offers (admin) users the possibility 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 to be used when editing content.
||Type of the relation (see next paragraph)
||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.
||Content types that are allowed to be linked.
||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.
||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.
A relation always has a "type". The type tells about the kind of relation. Integrated offers some build in types:
||Used to link items that should be embedded in the content item. Useful for images, media, etc.
||Used to link items that tell about the taxonomy of the content, for example Keywords.
||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 needs to change the code. For further reference see the Use relations in code documentation.