Overview

The Title and Subtitle fields within a design are mandatory fields that are used by all items that you create.

Both the title and subtitle are often used when displaying information about an item, examples are illustrated below.

alt text

The title or subtitle that appears in a item is determined by the configuration of the design that the item is based on. There are three ways in which you can configure the Title and Subtitle fields within a design.

Leave the fields blank

You can leave the fields blank when you create the design. Items created using a design with blank fields are assigned the Item Id as the title and the Name of the design as the subtitle.

alt text

Fixed title and subtitle

You can enter a fixed title and subtitle. Items created using a design with fixed content will all have the same title and subtitle.

alt text

In the example shown, every item created using the Bollard Type 1 design will have the same title and subtitle, which visually may not be that useful when you select an item.

Creating a variable title or subtitle

Alloy allows you to enter a variable in the Title or Subtitle field, this allows you to generate unique titles or subtitles for each item created that is based on that design.

alt text

Using the title and subtitle variable editor

When you edit a design, General tab, you can select the Title or Subtitle field . Selecting either of the fields displays the variable editor.

alt text

You can use the editor to enter a variable in either field. When you enter the first curly brackets, the editor displays a dialog that contains a list of attributes within the current design.

alt text

When you select an attribute the editor completes the variable entry. Selecting an attribute links the Title or Subtitle field to the content of the selected attribute. You can select attributes from the current design or from parent and child designs connected to the current design.

alt text

Understanding variable formats

The format of a typical variable consists of an attribute code enclosed in ‘curly’ brackets - {{attributes_designAttribute}}

Examples:

For a standard attribute: {{attributes_streetLightingUnitsUnitNumber}}

For a custom attribute: {{attributes_bollardType1BollardType1_5caef948ff5c130f7075f0e5}}

You can also combine text together with the variable within a Title or Subtitle field to further customise the appearance of the fields.

Example:

Unit Number: {{attributes_streetLightingUnitsUnitNumber}}

Conditional variable formats

Alloy allows you to enter variables that include conditional statements to define the content of the Title or Subtitle field.

Example:

{{#if attributes_exampleDesignDateField}}
The Date is: {{attributes_exampleDesignDateField}}
{{/if}}

When you use an if statement then you must close the statement on the last line. In this example, if the Date Field attribute contains a date, it will be displayed in the Title or Subtitle field. By default if there is no date, then the Item Id is displayed. Alternatively, you can add an else to statement to display the contents of an alternative attribute.

{{#if attributes_exampleDesignDateField}}
The Date is: {{attributes_exampleDesignDateField}}
{{#else}}
{{attributes_exampleDesignTextField}}
{{/if}}

In this example the content of the Text Field is displayed if there is no date in the Date Field.

Note

You can include multiple ‘if’ statements within the fields, however, you cannot use any other logic statements within the field, for example, greater than or less than, and so on.

Preview your variable

The variable editor allows you to preview the output of the variables before you save your settings. The editor uses any existing item based on the current design.

Select the Item to preview field at the bottom of the variable editor window to display a list of existing items based on the design. This then allows you to preview the output of the variables that you have entered.

alt text

Once you have selected an item the preview is generated automatically. Any changes you make to the variables are reflected in the preview at the same time.

Note

The preview does not affect the contents of the existing item that you selected.

Finding an attribute code

There are instances that you need to enter an attribute code manually. Attribute codes, especially custom attribute codes can be quite long, fortunately there is a quick way to find them and copy and paste them into a field to use as a variable.

  1. Select a design to view its details

  2. In the Item details panel, select the Attributes tab. You can also open the design diagram and select the attribute’s icon.

  3. Select an attribute. Its details open in the Item details panel.

alt text

The attribute code is displayed in the Code field, you can double click this field to highlight the contents and copy it to the clipboard (Ctrl + c).

  1. Return to the design and edit the design, this allows you to paste (Ctrl + v) the code into the Title or Subtitle field, you must add the {{ }} around the code to complete the format of the variable.