---
title: "TypoScript coding guidelines"
manual: "TYPO3 Explained"
version: "11.5"
permalink: "https://docs.typo3.org/permalink/t3coreapi:cgl-typoscript@11.5"
source: "CodingGuidelines/CglTypoScript/Index.rst"
rendered: "2026-10-21T15:30:00+00:00"
---

# TypoScript coding guidelines {#cgl-typoscript}

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

-   The file extension **should** be `.typoscript`.
-   TypoScript files are located in the directory `<extension>/Configuration/TypoScript`.
-   File name for constants in static templates: `constants.typoscript`.
-   File name for TypoScript in static templates: `setup.typoscript`.

More information about the file ending:

-   TypoScript files used to have the ending `.txt`.
-   It is also possible to use the ending `.ts`. This is
    not recommended because it is also used by TypeScript.
-   Therefore, you should use `.typoscript`.

> [!NOTE]
> **See also**
>
> Changelog: [Feature: #78161 - Introduce .typoscript file extension](https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/8.7.x/Feature-78161-IntroduceTypoScriptFileExtension.html)

## Format {#format}

-   Use spaces, not TABs.
-   Use 2 spaces per indenting level.

## More information {#more-information}

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