In-line 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 appear in-line in fields with XHTML content.

Syntax
<relation
    id-ref="text"?
    (source="text" sourceid="text")?
    dbid="text"?
    exported-dbid="text"?
    publication-name="text"?
  >
  <field>...</field>*
</relation>

Only one form of the field element may be used: Standard field.

Examples
  • This example shows an "in-line" relation element used to include a link to another content item in a field. The field must be defined with mime-type="application/xhmtl+xml" in the content-type resource. Note that when used in-line, the relation element has no type attribute.

    <field name="body">
      <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nunc venenatis erat at nisl. In hac habitasse platea dictumst.</p>
      <p>
        <relation source="ex" sourceid="13"/>
      </p>
    </field>
  • This example shows a relation used in-line to include an "image" content item.

    <content source="ex" sourceid="17" type="news" state="published">
      <section-ref source="ex" sourceid="s2" home-section="true"/>
      <field name="title">Ex Article 7</field>
      <field name="leadtext">Seventh 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>
          <relation source="ex" sourceid="20"/>
        </p>
      </field>
    </content>
Attributes
id-ref="text" (optional)

The id of the related content item. If this attribute is specified, a content element with an id attribute that matches this attribute must appear somewhere before this relation element in the syndication file.

If dbid or source and sourceid are specified, then this attribute is ignored.

source="text" (optional)

The source of the related content item. If this attribute is specified, then sourceid must also be specified. One of the following two conditions must be satisfied:

  • The target publication must already contain a content item with source and sourceid attributes that match this element's source and sourceid, or

  • A content element with source and sourceid attributes that match source and sourceid must appear somewhere before this relation element in the syndication file.

If dbid is specified, then source and sourceid are ignored.

sourceid="text" (optional)

The sourceid of the related content item. If this attribute is specified, then source must also be specified. One of the following two conditions must be satisfied:

  • The target publication must already contain a content item with source and sourceid attributes that match this element's source and sourceid, or

  • A content element with source and sourceid attributes that match source and sourceid must appear somewhere before this relation element in the syndication file.

If dbid is specified, then source and sourceid 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 a dbid attribute that matches this attribute must appear somewhere before this relation 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 and source-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.