Overview
This product is a Directus extension that allows for the automatic calculation of field values based on other fields within the same item. It supports templating and arithmetic operations, such as concatenation, summation, subtraction, multiplication, modulo, and conversion to slug or currency. The extension can also be used as an alias field. The calculations are performed on the client side and the extension is lightweight, without the need for third-party libraries.
Features
- Templating and arithmetic operations
- Field value calculation based on other fields
- Support for alias fields
- Lightweight and no third-party libraries
Installation
To install the theme, follow these steps:
- Go to Settings in Directus.
- Create a new field with type string or number.
- In the Interface panel, choose Computed interface.
- Configure the following options:
- Template: Determines how the field is calculated. Refer to the syntax section for more details.
- Field Mode: Choose how the value is displayed (null, Display Only, Read Only).
- Prefix: Specifies a string to prefix the computed value.
- Suffix: Specifies a string to suffix the computed value.
- Custom CSS: Allows for inline style binding to customize the appearance of the computed value.
- Debug Mode: Used for debugging the template.
- Compute If Empty: Computes the value if the field is empty.
- Initial Compute: Computes the value when opening the form.
- Save the configuration.
Summary
This product is a Directus extension that enables the calculation of field values based on other fields within the same item. It supports a variety of arithmetic operations and templating options. The extension is lightweight and does not require the use of third-party libraries. Installation involves creating a new field with specific configurations in the Directus settings.