Provide tokens with/out unit and target unit

Created on 14 August 2024, 5 months ago

Problem/Motivation

Currently the module only provides default tokens for the field values.

For more complex use-cases, where you handle all physical field values in a unified unit, but need to output it in different unit(s) (see Allow selecting an output unit different from the input unit (field display) RTBC ), this is not enough.

The module should provide additional tokens with modifiers:
[entity:field_phsyical_example] // The regular output with default unit
[entity:field_phsyical_example:value] // The raw value without unit
[entity:field_phsyical_example:unit] // The default unit
[entity:field_phsyical_example:TARGET-UNIT] e.g. [entity:field_phsyical_example:mm] // The regular output with target unit
[entity:field_phsyical_example:value:TARGET-UNIT] e.g. [entity:field_phsyical_example:value:mm] // The raw value in target unit without unit.

Maybe the TARGET-UNIT modifiers can be created dynamically based on all available target units?

Steps to reproduce

Need to output a physical field value as token

  • With default unit
  • Without unit
  • In another unit
  • In anouter unit without unit
  • ...?

Proposed resolution

Implement as described above

Remaining tasks

  • Check the current status (what's already available as tokens)
  • Discuss the goal and modifier names & functionality
  • Implement
  • Test
  • Release

User interface changes

None

API changes

None

Data model changes

None

Feature request
Status

Active

Version

1.0

Component

Code

Created by

🇩🇪Germany Anybody Porta Westfalica

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024