---
title: "TypoScript provider for sites and sets"
manual: "TypoScript Explained"
version: "main"
permalink: "https://docs.typo3.org/permalink/t3tsref:typoscript-site-sets@main"
source: "UsingSetting/SiteTypoScriptProvider.rst"
rendered: "2026-09-28T04:44:10+00:00"
---

# TypoScript provider for sites and sets {#typoscript-site-sets}

By design, a site TypoScript provider always defines a new scope
(root-flag) and does not inherit from parent sites (for example, sites up in the
root line). This behavior is not configurable by design, as TypoScript code sharing
is intended to be implemented via [sharable sets](https://docs.typo3.org/permalink/t3tsref:typoscript-site-sets-set@main).

Note that [sys_template](https://docs.typo3.org/permalink/t3tsref:typoscript-syntax-typoscript-templates-structure@main)
records will still be loaded, but they are optional,
and applied after the TypoScript provided by the site.

TypoScript dependencies can be included
via [set dependencies](https://docs.typo3.org/m/typo3/reference-coreapi/main/en-us/ApiOverview/SiteHandling/SiteSets/Index.html#site-sets-usage).

-   [Site as a TypoScript provider](https://docs.typo3.org/permalink/t3tsref:site-as-a-typoscript-provider@main)
-   [Set as a TypoScript provider](https://docs.typo3.org/permalink/t3tsref:set-as-a-typoscript-provider@main)

## Site as a TypoScript provider {#typoscript-site-sets-site}

The files `setup.typoscript` and `constants.typoscript` (placed next
to the site's `config.yaml` file) will be loaded as TypoScript setup and
constants, if available. See also [Site handling](https://docs.typo3.org/m/typo3/reference-coreapi/main/en-us/ApiOverview/SiteHandling/Index.html#sitehandling).

Site dependencies (sets) will be loaded first, that means setup and constants
can be overridden on a per-site basis.

### Example: A site that depends on a sitepackage {#typoscript-site-sets-site-example}

The following site configuration depends on a site set provided by
a sitepackage extension.

**config/sites/my-site/config.yaml**

```yaml
base: 'http://example.com/'
rootPageId: 1
dependencies:
  - myvendor/my-sitepackage

```

You can place TypoScript constants or setup in files of that name in the same
folder like the site configuration:

**config/sites/my-site/setup.typoscript**

```typoscript
page.headerData {
  50 = TEXT
  50.value = <!-- This is only displayed in the header of site example.org -->
}

```

Same goes for TypoScript constants:

**config/sites/my-site/constants.typoscript**

```typoscript
page.trackingCode = 123456
```

## Set as a TypoScript provider {#typoscript-site-sets-set}

Set-defined TypoScript can be shipped within a set. The files
`setup.typoscript` and `constants.typoscript` (placed next to the
`config.yaml` file of the set) will be loaded, if available.
They are inserted into the [site TypoScript](https://docs.typo3.org/permalink/t3tsref:typoscript-site-sets-site@main)
chain of every site that uses the set.

Set constants will always be overruled by
[site settings](https://docs.typo3.org/m/typo3/reference-coreapi/main/en-us/ApiOverview/SiteHandling/SiteSettings.html#sitehandling-settings). Since site settings
always provide a default value, a TypoScript constant will always be overruled by a defined
setting. This can be used to provide backward compatibility with TYPO3 v12
in extensions, where constants shall be used in v12, while v13 will always
prefer defined site settings.

Dependencies on TypoScript in other extensions or other sets are declared
as `dependencies` in the `config.yaml` file of the set.

Dependencies are included recursively and are automatically ordered and
deduplicated. That means TypoScript will not be loaded multiple times, if a
shared dependency is required by multiple sets.

> [!NOTE]
> `@import` statements can still be used for local includes, but
> should be avoided for cross-set/extensions dependencies.

### Example: The set of a sitepackage {#typoscript-site-sets-set-example}

The following set of a sitepackage depends on the TypoScript and other settings
of [EXT:fluid_styled_content](https://extensions.typo3.org/extension/fluid_styled_content) and [EXT:felogin](https://extensions.typo3.org/extension/felogin):

**EXT:my_sitepackage/Configuration/Sets/MySitepackage/config.yaml**

```yaml
name: myvendor/my-sitepackage
label: My sitepackage set

# Load TypoScript, TSconfig and settings from dependencies
dependencies:
  - typo3/fluid-styled-content
  - typo3/felogin

```

The set can be included as a dependency by other sets or a
[site configuration](https://docs.typo3.org/permalink/t3tsref:typoscript-site-sets-site-example@main).

The set can include further TypoScript constants or setup. It can use
`@import` statements to import TypoScript from another location:

**EXT:my_sitepackage/Configuration/Sets/MySitepackage/constants.typoscript**

```typoscript
@import 'EXT:my_sitepackage/Configuration/TypoScript/Constants'
```

**EXT:my_sitepackage/Configuration/Sets/MySitepackage/setup.typoscript**

```typoscript
@import 'EXT:my_sitepackage/Configuration/TypoScript/Setup'
```

Importing TypoScript already contained in other sets should be avoided in
favour of using a [set dependency](https://docs.typo3.org/m/typo3/reference-coreapi/main/en-us/ApiOverview/SiteHandling/SiteSets/Index.html#site-sets-definition).
