Package variables
Use package variables to access an item in the package or a value of such an item.
A package variable is a string consisting of an item name, possibly followed by a value selector, a further string that specifies the value to retrieve for that item. Strings are concatenated using the period (.) character.
For example, the string Component.MetaData.Author refers to the value of the Author field of the MetaData fields of the current Component. Component is the item name and .MetaData.Author is the value selector.
Predefined item names
Some item names in a package have a special and specific meaning to the Compound Template that processes the package. Do not create items in the package that have one of these names, unless they are in fact items as specified here.
The reserved item names (stored in constants in the Package class) are as follows:
| Item name | Description |
|---|---|
Component | The Component currently being processed. |
Components | The list of Components associated with the Page currently being processed. |
Page | The Page currently being processed |
ComponentTemplate | The Component Template used to transform the Component currently being processed. |
Field | That Field of a Component that is currently being processed; or, when iterating over the values multivalue field, the Field value that is currently being processed. |
Output | The publishable output to send to the Content Delivery server. |
TemplateRepeatIndex | The index of the repeating region currently being processed. A Dreamweaver template uses repeating regions to iterate over items, such as the Components on a Page or the Fields in a Component. |
FieldPath | The full path to the current item being iterated over. |
Value selectors
Depending on the content type of the package item, you can add the following value selectors to the item name:
NameorTitle-
Returns the name or title of the item. You can also place this after a value selector if the expression refers to a Content Manager item.
Use with: Component, Page, Component Template, Field, Schema selector, Publication Selector
ID-
Returns the unique identifier (Content Manager URI) of the item. You can also place this after a value selector if the expression refers to a Content Manager item.
Use with: Component, Page, Component Template, Schema selector, Publication Selector
ContentType-
Returns the type of content of the item. You can also place this after a value selector if the expression refers to a Content Manager item.
Use with: Component, Page, Component Template, Field, Schema selector, Publication selector
Properties.<PropertyName>-
Returns the value of the package item property called
<PropertyName>.Use with: Component, Page, Component Template, Field, Output
<FieldName>-
Returns the value of a data or metadata field of the item called
<FieldName>. If there both a data and a metadata field with this name exist, returns the value of the data field. If<FieldName>is identical to the name of a modifier, useFields(see below).Use with: Component, Page, Component Template, Publication selector
Fields-
Use this selector, followed by a
<FieldName>, to access a data field with a name that is identical to that of a value selector.Use with: Component
MetaData-
Use this selector, followed by a <FieldName>, to access a metadata field with a name that is identical to that of a data field or to that of a value selector.
Use with: Component, Page, Component Template, Publication selector
<EmbeddedFieldName>.<SubFieldName>-
Return the value of a data field called
<SubFieldName>of an embedded field called<EmbeddedFieldName>. For example, if a Component contains an embedded field calledAddressthat is based on a Schema with a field calledStreetName,Component.Address.StreetNamereturns the street name.Use with: Component
Values-
Placed after a
<FieldName>selector that refers to a multivalue field, returns an array of values for the field.Use with: Component
Schema-
Returns the Schema on which this item is based
Use with: Component
Publication-
Returns the Publication that contains this item
Use with: Use with: Component, Page, Component Template, Schema selector
Content-
Returns the string contents of a Component Template
Use with: Component Template
TemplateType-
Returns the type of a Component Template
Use with: Component Template
OutputFormat-
Returns the output format of a Component Template
Use with: Component Template
IsRepositoryPublishable-
Returns
trueif Component Presentations that use this Component Template can be published separately,falseif they cannot.Use with: Component Template