---
title: "YAML coding guidelines"
manual: "TYPO3 Explained"
version: "main"
permalink: "https://docs.typo3.org/permalink/t3coreapi:cgl-yaml@main"
source: "CodingGuidelines/CglYaml.rst"
rendered: "2026-09-20T15:52:37+00:00"
---

# YAML coding guidelines {#cgl-yaml}

YAML is (one of the languages) used for configuration in TYPO3.

## Directory and file names {#cgl-yaml-directory-file-names}

-   Files have the ending `.yaml`.

## Format {#cgl-yaml-format}

-   Use spaces, not tabs
-   Indent with 2 spaces per indent level
-   Favor single-quoted strings (' ') over double-quoted or multi-line strings where
    possible
-   Double quoted strings should only be used when more complex escape
    characters are required.  String values with line breaks should use multi-line
    block strings in YAML.
-   The quotes on a trivial string value (a single word or similar) may be omitted.

**Example: string formatting in YAML**

```yaml
trivial: aValue
simple: 'This is a "salt" used for various kinds of encryption ...'
complex: "This string has unicode escaped characters, like \x0d\x0a"
multi: |
   This is a multi-line string.

   Line breaks are preserved in this value. It's good for including

   <em>HTML snippets</em>.
```

## More information {#cgl-yaml-information}

-   See [Setup IDE / editor](https://docs.typo3.org/permalink/t3coreapi:cgl-ide@main) in this manual for information about setting up your Editor / IDE to adhere to
    the coding guidelines.
