diff --git a/src/developer/nodes-system/index.rst b/src/developer/nodes-system/index.rst index 1b2c418..5e1f43e 100644 --- a/src/developer/nodes-system/index.rst +++ b/src/developer/nodes-system/index.rst @@ -8,4 +8,5 @@ Node system intro node_types node_type_fields + node_type_decorators nodes diff --git a/src/developer/nodes-system/node_type_decorators.rst b/src/developer/nodes-system/node_type_decorators.rst new file mode 100644 index 0000000..730ea58 --- /dev/null +++ b/src/developer/nodes-system/node_type_decorators.rst @@ -0,0 +1,103 @@ +.. _node_type_decorators: + + +Node-type Decorators +==================== + +Roadiz allows you to customize any node-types and node-type fields **non-structural** properties. +This can be handy if you need to change node-types appearence (display names, colors) in Back-office without needing to update your project configuration or emptying caches. + +Entity representation +--------------------- + +This decoration is represented by the NodeTypeDecorator entity, which contains three fields : + + - ``path`` + - ``property`` + - ``value`` + +``path`` property : +^^^^^^^^^^^^^^^^^^^ + +This property is used to define the *node type* or *node type field* we want to customize. + +It consists of the ``node type name`` and the ``node type field name`` separated by a ``dot``. + +.. note:: + Exemple of ``path`` for the content field of a Page : + + ``Page.content`` + +.. warning:: + For decorate an property of a node type simply leave empty after the dot. : + + ``Page.`` + + +``property`` property : +^^^^^^^^^^^^^^^^^^^ + +This property is used to define the *node type property* or *node type field property* we want to customize. + +It consists of a ``Enum`` which depends on the path containing a field or not. + +**List of the property for node type :** + +#. displayName +#. description +#. color + +**List of the property for node type field :** + +#. field_label +#. field_universal +#. field_description +#. field_placeholder +#. field_visible +#. field_min_length +#. field_max_length + +.. note:: + Example of ``property`` for the content field of a Page : + + ``field_label`` + +.. warning:: + You can't attribute a ``node type`` property to a ``path`` with field + (exemple: path = ``Page.`` and property = ``field_label``) + + You can't attribute a ``node type field`` property to a ``path`` without field + (exemple: path = ``Page.content`` and property = ``displayName``) + +``value`` property : +^^^^^^^^^^^^^^^^^^^ + +This property is used to override the default value. Default values come from your `node_types/*.yaml` files. + +It consists of a string linked to its property type. + +List of the property type : + + - **display_name** => text type + - **description** => text type + - **color** => hexadecimal color type + - **field_label** => text type + - **field_universal** => boolean type + - **field_description** => text type + - **field_placeholder** => text type + - **field_visible** => boolean type + - **field_min_length** => integer type + - **field_max_length** => integer type + +.. note:: + Exemple of ``value`` on the ``field_label`` property : + ``'A text Label'`` + + Exemple of ``value`` on the ``field_visible`` property : + ``'true'`` + + Exemple of ``value`` on the ``color`` property : + ``'#FF1185'`` + + Exemple of ``value`` on the ``field_max_length`` property : + ``'15'``