# Templates with multiple files

Some programming patterns and frameworks require a set of related files, usually with a very specific structure.

In CLion, you can create sets of related files by adding child templates to a file template. When you create a file from such a template, it will also create files from child templates.

Procedure: Create a template with multiple files

1. In the Settings dialog (`Ctrl+Alt+S` (Windows), `⌘ Comma` (macOS), `⌘ Comma` (IntelliJ IDEA Classic (macOS)), `⌘ Comma` (macOS System Shortcuts), `Ctrl+Alt+S` (XWin), `Ctrl+Alt+S` (GNOME), `Ctrl+Alt+S` (KDE), `Ctrl+Alt+S` (Emacs), `Ctrl+Alt+S` (Sublime Text), `⌘ Comma` (Sublime Text (macOS)), `⌘ Comma` (Xcode), `Ctrl+Alt+S` (Visual Studio), `⌘ Comma` (Visual Studio (macOS)), `Ctrl+Alt+S` (ReSharper), `⌘ Comma` (ReSharper (macOS)), `Ctrl+Alt+S` (QtCreator), `⌘ Comma` (QtCreator (macOS)), `Ctrl+Alt+S` (NetBeans), `Ctrl+Alt+S` (Eclipse), `⌘ Comma` (Eclipse (macOS))), select `Editor | File and Code Templates`.

2. Create the main file template.

On the Files tab, click ![the Create Template button](https://resources.jetbrains.com/help/img/idea/2026.2/app.expui.general.add.svg) and specify the name, file extension, and body of the template.

3. Select the new template in the list and click ![The Create Child Template File button](https://resources.jetbrains.com/help/img/idea/2026.2/app.fileTypes.addAny.svg) on the toolbar. Specify the name, file extension, and body of the child template.

> **Note:**
> All child templates share the [variables](file-template-variables.html) of the main file template.
>
>
>
>
>
> You cannot add child templates to the default file templates.

