yamlescapingbolt-cms

Escape character for labels in Bolt CMS


When I create a field with a label in the YAML, the label is not valid when I try to add an % for example. The following code is my current try.

content_image:
    fields:
        image:
            type: image
            label: "Afbeelding 100%"

As a guess I tried to do use \% as an escape character, but that does not solve it. Reading the documentation I cannot seem to find this information, and it keeps wondering if it is possible at all.

So my question: Is there an escape character in Bolt CMS to add to labels?


Solution

  • For this use case I fixed it by doing:

    label: "Afbeelding 100% "
    

    As you can see, I added a space (or any other character) after the % because otherwise the system would not allow it. A label can't end with a % for some reason, and when you place a space after a % there is no need for an escape character.