Documentation Center

Understanding the use of variables in metadata configuration

Introduction

The dialogs and list views are dynamically created from the metadata configuration XML.

Variables can be used to initialize a field value when creating an object, or to overwrite the value on an existing object. They are resolved after the metadata of an object is retrieved.

How should variables be used?

Variables can be added by adding the var to the element value.

<value>
   <var name="variable" />
</value>

When a variable is used no other element or text should be added to the value. Only a single var element is allowed.

Which variables are currently used?

NameDescriptionRemarks
newguidGets the string representation of a newly generated GUID.

Format: GUID-dddddddd-dddd-dddd-dddd-dddddddddddd, where d represents a hexadecimal digit whose case is ignored, e.g. GUID-375FDC9F-E94A-475A-A3F5-AE5DE55FB151.

currentdateGets the current date and time.
currentusernameGets the user who is currently logged on.
defaultlanguageGets the default language.

In Organize Space, the default language is specified on the User Properties of the currently signed-in user on the Settings tab.

In Client Tools, the default language is specified on the options dialog (Tridion Docs > Accounts > Settings > Default language).

defaultresolutionGets the default resolution.

In Organize Space, the default resolution is specified on the Default Settings on the Settings tab.

In Client Tools, the default resolution is specified on options dialog (Tridion Docs > Accounts > Settings > Default resolution).

initialstatusGets the initial status of an object.

The initial statuses depend on the object type. They are specified on the Initial Statuses on the Settings tab of Organize Space.

Example 1

This example demonstrates how to set the working resolution of a publication to the default resolution.

<ishfrmfield name="PublicationResolutionField" ishfieldref="FISHREQUIREDRESOLUTIONS" level="version">
  <label resourceref="PublicationResolutionField.Label">Working resolution</label>
  <description resourceref="PublicationResolutionField.Description">The resolution used for assembling the publication.</description>
  <typepulldown>
    <valuelist>
      <lovlist ishlovref="DRESOLUTION" />
    </valuelist>
  </typepulldown>
  <value>
    <var name="defaultresolution" />
  </value>
</ishfrmfield>

Example 2

This example demonstrates how to reset the status when creating a new version of a content object (e.g. topic, map).

<ishfrmfield id="StatusField" name="StatusField" ishfieldref="FSTATUS" level="lng">
  <label resourceref="FSTATUS.Label">Status</label>
  <description resourceref="FSTATUS.Description">Indicator of the progress of the object.</description>
  <typepulldown>
    <valuelist>
      <transitionstatelist />
    </valuelist>
  </typepulldown>
  <mandatory />
  <value overwrite="yes">
    <var name="initialstatus" />
  </value>
</ishfrmfield>