Configuring item types

The <ItemType> element in the TranslationManager.xml file is an optional configuration element that you can define for each translatable Content Manager item type to customize what data is sent to SDL TMS and how.

About this task

The <ItemType> element allows you to:

  • Aggregate data to merge content from several XML files into a single XML document (also known as stitching)
  • Evaluate nodes within the TCM namespace of a translatable Content Manager item to prevent empty content from being sent for translation

You can define an <ItemType> element for each translatable Content Manager item. The following example shows an <ItemType> defined for Folders where the Title of all Folders are aggregated into a single XML file (the translator will therefore receive a list of titles to translate):

<ItemTypes xmlns:tcm="http://www.tridion.com/ContentManager/5.0">
           <ItemType type="2" fileExtension="FOL">
             <Includes>
               <Include id="title" aggregate="true">/tcm:Folder/tcm:Data/tcm:Title</Include>
             </Includes>
           </ItemType>
 </ItemTypes>

An <ItemType> element contains one or more <Include> elements that defines an XPath statement targeting a node within the item XML to identify the translatable content. You can target elements in the TCM namespace within the <Tcm:Data> node of a translatable Content Manager item, therefore you need to declare the tcm prefix used in the <Include> elements XPath statements either in the <Include> elements or in a parent element.

If you do not define your own <ItemType> elements, by default the Translation Manager evaluates the nodes within an item's <Tcm:Data> node and sends the nodes containing content for translation and in separate files, although note that the default analysis (ANL) files strip markup elements from the XML not relevant for translation. If you define your own <ItemType> elements, your values override the default settings.

The <ItemType> element has the following mandatory attributes:

Attribute (ItemType)Description
typeThe Tridion item type number:
  • 2 for Folders
  • 4 for Structure Groups
  • 16 for Components
  • 64 for Pages
  • 1024 for Keywords
fileExtension

The file extension used for the XML files sent to SDL TMS. The file extension must consist of three characters. Note also that stitched files for an item type are sent with an x postfixed to the extension.

As you can specify the ANL file based on the file extension, you can use different ANL files to filter content for each item type.

On SDL TMS, you must define a corresponding Content Type to specify that this the type of content can be passed for translation.

The <Include> element and has the following mandatory attributes:

Attribute (Include)Description
idAn attribute with a string value uniquely identifying the include within the item type.
aggregate

If set to true, the XPath statement identifies nodes where translatable text from several items can be aggregated into a single translation document (used for aggregating small strings together, such as the titles in Components).

If set to false, the XPath statement identifies translatable text that you do not want merged into a single XML document, for example the tcm:Content and tcm/Metadata nodes (and for content that needs to remain together to keep the context of the text intact).

The <Include> elements in an <ItemType> are processed depending on the value of the aggregate attribute:

  1. The <Include> elements with aggregate="false" are evaluated first; if one or more of the element's XPaths evaluates to valid content, a translation file is created for the item and <Include> elements with aggregate="true" are ignored, otherwise they are processed (see step 2).
  2. For each <Include> element with aggregate="true", the XPath is evaluated and the results inserted into a document shared between the items of the specific item type.
  3. If an <ItemType> element has no <Include> statements, no items of that type will be translated.

Content is considered valid according to the aggregate attribute when it meets the following criteria:

  • If aggregate="false", an XPath statement is considered to evaluate to valid content according if:

    • The XPath returns a node that is not null and
    • The returned node contains at least 1 child element
  • If aggregate="true", an XPath statement is considered to evaluate to valid content according if:

    • The xpath returns a node that is not null and
    • The node contains a non empty text string

Procedure

  1. Open the TranslationManager.xml file in a text editor. By default, the file is located in your Tridion installation \config directory.
  2. Declare the tcm namespace element:
    You must declare the namespace prefix used in the XPath statements in the <Include> elements, either in this element or in one of its parent elements. In the following example, the tcm prefix is declared in the <ItemTypes> element containing all the ItemType configurations used:
    <ItemTypes xmlns:tcm="http://www.tridion.com/ContentManager/5.0">
    </ItemTypes>
  3. Enter, for example, the following code:
    <ItemTypes xmlns:tcm="http://www.tridion.com/ContentManager/5.0">
               <ItemType type="2" fileExtension="FOL">
                 <Includes>
                   <Include id="title" aggregate="true">/tcm:Folder/tcm:Data/tcm:Title</Include>
                 </Includes>
               </ItemType>
     </ItemTypes>

    The example above shows an <ItemType> defined for Folder elements. The Title field of Folders are sent for translation in a stitched file. The item XML for the folder will not be translated directly as there is no "non-aggregated" include.

  4. Save and close the file.