Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Section
titleUse the Value Range

Using the value range comprised

  1. the definition of a property using the value range by the template author (template) or author (document instance)
  2. the selection of an actual value by the page author
Section
titleDefine Range Property

To use the value range in your documents you typically ask the template author to define a blueprint and add the configuration to the template. In this example we will do this manually first. That is the a property is manually added to a document instance by the author.

Section
titlePer Instance

For this example we assume that the author creates a Topic document.

Add a new property called 'Status' to the document by adding a line to the properties table (within the Document Properties Marker Macro). Use the Name List Macro as a value to the property.

Open the macro editor for the Name List Macro and set the following parameters:

ParameterValueExplanation
DoctypetagSelect on the Tag doctype. Please note that you specify the identifier of the doctype and therefore it is all lower-case.
PropertyStatusThis is not mandatory and only affects searching if specified via a blueprint.
Where$<Parent>=[Status]Select the valid values for this property. By defining an exact match we restrict the range to those values of doctype Tag whose parent document is the Status document we created in step one.

You may also limit the search for valid values on specific spaces. Please refer to delegate-space Delegate Space for more information on how to use delegate spaces to define common information that applied to all delegating spaces.

Question Box
titleWhy not Tag List Macro?

Since we use the Tag doctype you may ask why we use the Name List Macro and not the Tag List Macro. The difference between the two is that the latter also includes the labels of a page as values. Since you want to control the range of valid values, the Name List Macro is a valid choice.

If you save the page, you'll see ... nothing!?!

That is because we just have defined a property and a valid range of values, but actually did not select one. Properties without a value are not shown by default (to not clutter the view with non-information).

The template author may select one as default, which would be 'Open' in this example or leave the selection completely to the author. See Select a Value for details.

Section
titleUsing a Blueprint

Specifying a property value for a class of documents is typically resolved by the creation of a blueprint.

In this case the template author adds the property with the configured Name List Macro to the table of properties using the Storage Format syntax.

Code Block
languagexml
titleProperty Definition in XML
<tr>
  <th>Status</th>
  <td>
    <ac:structured-macro ac:name="projectdoc-name-list">
      <ac:parameter ac:name="doctype">tag</ac:parameter>
      <ac:parameter ac:name="property">Status</ac:parameter>
      <ac:parameter ac:name="where">$&lt;Parent&gt;=[Status]</ac:parameter>
      <ac:parameter ac:name="empty-as-none">false</ac:parameter>
    </ac:structured-macro>
 </td>
 <td> </td>
</tr>
Note Box
titleI18N

For internationalization you probably want to replace the strings Status and Parent with a I18N key.

Section
titleSelect a Value

To select a value the author can check the valid set of values by deselecting the Empty Where Clause Handling.

Select one of the values and set it as the value to the Names parameter.

Save the macro and then save the page. The result is this:

...

Section
titleReferences

Section
titleResources

Piwik Set Multiple Custom Variables
NameValue
Departmentprojectdoc
Categoryprojectdoc-tip
Typehowto