Document Modelling

Inheriting Structure Values

In some cases documents should inherit specific values from their structure node location by default. This site explains how to configure and use this feature.

Configuration

If a document's field should inherit its value from structure, both the document's node type and the node type 'sophora-nt:structureNode2' require the property with the same name and analog configuration. In 'sophora-nt:structureNode2' the property must be configured on the Base tab. In the document's node type the property can be configured on any form tab. In both configurations the checkbox "Inherit structure value" must be checked in the input field type parameters.

Property Configuration for Inheriting Structure Values
Property Configuration for Inheriting Structure Values (Image: subshell/CC BY)

Not all input field types support inheriting of structure values.

Setting the Structure Value

To set the value which documents should inherit, open the editor of a structure node (by context menu "Edit" in the Structure view), go to the Configuration tab and enter the value in the field. Since structure nodes inherit the values from their parent structure node the usage and behavior of those fields is similar to such fields in the document editor (see next section).

Value in Structure
Value in Structure (Image: subshell/CC BY)

Usage in Documents

In the document editor each field that can inherit its value from the document's structure node has an additional checkbox behind the label of the field. If the checkbox is not checked, the value is inherited and displayed in gray. It is not possible to edit the field in this case.

Inherited Property Value in Document Editor
Inherited Property Value in Document Editor (Image: subshell/CC BY)

To overwrite an inherited value the checkbox must be checked. After doing so, the displayed value becomes black and the value in the field can be edited.

Overwritten Property Value in Document Editor
Overwritten Property Value in Document Editor (Image: subshell/CC BY)

Last modified on 10/16/20

The content of this page is licensed under the CC BY 4.0 License. Code samples are licensed under the MIT License.

Icon