Typed relation
Represents a relationship between the content item
represented by this element's owning content
element, and another content item. This form of the
relation
element may only appear as a direct
child of a content
element.
relation
elements that appear in-line inside
field elements
may not have a
type
attribute.
Syntax
<relation id-ref="text"? (source="text" sourceid="text")? dbid="text"? exported-dbid="text"? publication-name="text"? type="text" > <field>...</field>* </relation>
Only one form of the field
element may be used:
Standard field.
Examples
This example shows a
relation
element used to insert a relation to an "image" content item. The optionalfield
element inside therelation
locally overrides the content of the same field in the referenced content item.<content source="ex" sourceid="13" type="news" state="published"> <section-ref source="ex" sourceid="s2" home-section="true"/> <field name="title">Ex Article 5</field> <field name="leadtext">Fifth article</field> <field name="body"> <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nunc venenatis erat at nisl. In hac habitasse platea dictumst.</p> <p>Sed venenatis purus iaculis turpis.</p> </field> <relation source="ex" sourceid="20" type="slides"> <field name="title">Croc on beach</field> </relation> </content>
Attributes
id-ref="
text"
(optional)-
The
id
of the related content item. If this attribute is specified, acontent
element with anid
attribute that matches this attribute must appear somewhere before thisrelation
element in the syndication file.If
dbid
orsource
andsourceid
are specified, then this attribute is ignored. source="
text"
(optional)-
The
source
of the related content item. If this attribute is specified, thensourceid
must also be specified. One of the following two conditions must be satisfied:-
The target publication must already contain a content item with
source
andsourceid
attributes that match this element'ssource
andsourceid
, or -
A
content
element withsource
andsourceid
attributes that matchsource
andsourceid
must appear somewhere before thisrelation
element in the syndication file.
If
dbid
is specified, thensource
andsourceid
are ignored. -
sourceid="
text"
(optional)-
The
sourceid
of the related content item. If this attribute is specified, thensource
must also be specified. One of the following two conditions must be satisfied:-
The target publication must already contain a content item with
source
andsourceid
attributes that match this element'ssource
andsourceid
, or -
A
content
element withsource
andsourceid
attributes that matchsource
andsourceid
must appear somewhere before thisrelation
element in the syndication file.
If
dbid
is specified, thensource
andsourceid
are ignored. -
dbid="
text"
(optional)-
The
dbid
of the related content item. If this attribute is specified, then one of the following two conditions must be satisfied:-
The target publication must already contain a content item with a
dbid
attribute that matches this attribute, or -
A
content
element with adbid
attribute that matches this attribute must appear somewhere before thisrelation
element in the syndication file.
This attribute is never present in syndication files that have been exported from a database. IDs are always written to
exported-dbid
attributes in exported syndication files. -
exported-dbid="
text"
(optional)-
The
dbid
of the related content item.This attribute is generated during export from the , but ignored during import. It is provided mainly for information and debugging purposes.
publication-name="
text"
(optional)-
The name of the publication to which the referenced content item or section belongs. This attribute may only be used in combination with the
source
andsource-id
attributes. It is needed to ensure unique identification in situations where cross-publishing is in use and the referenced content item or section does not belong to the current publication. type="
text"
-
Defines the type of relation represented by this
relation
element. For import, the value specified must be the name of a relation type as defined in the target publication'scontent-type
resource. The value you specify here will determine how the relationship defined by this element is presented both in the publication and in Content Studio.