Codelists
Codelists allow to map property values to a different value. This is useful especially for HTML representations.
Configuration
The following table describes the structure of the code list files.
Name | Default | Description | Type | Since |
---|---|---|---|---|
label | id | Human readable label. | string | v2.0 |
entries | {} | Map with the original value as key and the new value as value. | object | v2.0 |
sourceType | TEMPLATES | Always TEMPLATES . | string | v2.0 |
fallback | the value | Optional default value. | string | v2.0 |
For the target values in entries
and for fallback
also stringFormat transformations can be used. If the transformed value is intended for HTML output, then Markdown markup can also be used, this will be formatted in the HTML output.
Example
Based on the INSPIRE codelist EnvironmentalDomain, maps values like soil
to the German label of the entry in the INSPIRE codelist registry.
---
label: Umweltbereich, für den Umweltziele festgelegt werden können.
entries:
air: Luft
climateAndClimateChange: Klima und Klimawandel
healthProtection: Gesundheitsschutz
landUse: Bodennutzung
naturalResources: natürliche Ressourcen
natureAndBiodiversity: Natur und biologische Vielfalt
noise: Lärm
soil: Boden
sustainableDevelopment: nachhaltige Entwicklung
waste: Abfall
water: Wasser
Storage
Codelists reside under the relative path store/entities/codelists/{codelistId}.yml
in the data directory (old) or in the Store (new) as values with type codelists
.
When using the new store layout, codelists have a path instead of an id. That means for example values/codelists/bar.yml
would work like before, but you could additionally define values/codelists/foo/bar.yml
. To reference that codelist somewhere else in the configuration you would need to use foo/bar
.