Reason for the question: I have a tab on site.yml with fields that are used across pages in the templates. In order to find the fields more quickly, I would like to be able to see the field name immediately instead of first searching for it in the blueprint
I thought key would recognized automatically the value. In this case, however, the function makes no sense. Instead of using the field name with a query, it can also be written directly into the label field:
labelCookieSettings:
label: "Cookie-Einstellungen (labelCookieSettings)"
type: text
But that would be a duplication that I wanted to avoid.
I know how to read field values, but there doesn’t seem to be an elegant function for the field name, right?
This was my first Kirby project, which I built up with ignorance. In new projects I name the field names differently, then this solution request would be obsolete.
Your suggestion to write the field object directly in the field name would have been sufficient. The suggestion with {{page.fieldName.key}} had irritated me. However, it is not tragic if there is no workaround, as the field name addition would only have brought additional convenience. As mentioned: In future projects, I will name fields according to a more logical concept.
Thanks for your explanations though, there’s always more to learn about Kirby!