Site settings: Further configuration options

New in version 13.1

Site sets and settings therein have been introduced with TYPO3 13.1.

In step Minimal site package - Create a basic site set we created a basic site set for our site package.

In step Include the site sets of fluid-styled-content as dependency we added dependencies to our site set.

The site set

Changed in version 13.1

In TYPO3 v13.1 and above the TypoScript files are made available as sets and included in the site. For TYPO3 v12 read the section in the tutorial for TYPO3 v12.4: Make TypoScript available (TYPO3 v12.4).

In step Create a basic site set we already created a basic site set for your site package.

In step Include the site sets of fluid-styled-content as dependency we included the dependencies to the site sets of typo3/cms-fluid-styled-content .

Your site set configuration should now look like this:

EXT:site_package/Configuration/Sets/SitePackage/config.yaml
name: t3docs/site-package
label: Example site package set
dependencies:
  - typo3/fluid-styled-content
  - typo3/fluid-styled-content-css
Copied!

Line 1 defines the name of the set. As the example site-package extension only provides one set, the name of the set should be the same as the composer name.

In line 4 and 5 dependencies are defined. In this example the site package depends on typo3/cms-fluid-styled-content , therefore the sets provided by this system extension are included as dependency. By doing so all settings and TypoScript definitions provided by the extension are automatically included.

Your site set folder now contains the following files:

  • site_package/Configuration/Sets/SitePackage

    • config.yaml
    • page.tsconfig
    • setup.typoscript

Introduce site settings to configure fluid-styled-content

Place a file called settings.yaml in the folder Configuration/Sets/SitePackage.

We override some default settings of the site set Site set "Fluid Styled Content":

EXT:site_package/Configuration/Sets/SitePackage/settings.yaml
styles:
  templates:
    layoutRootPath: EXT:site_package/Resources/Private/Layouts/ContentElements
    partialRootPath: EXT:site_package/Resources/Private/Partials/ContentElements
    templateRootPath: EXT:site_package/Resources/Private/Templates/ContentElements
  content:
    textmedia:
      maxW: 1200
      maxWInText: 600
      linkWrap:
        lightboxEnabled: true
        lightboxCssClass: lightbox
Copied!

Here we override some values for maximal image width in text-media content elements, we enable a lightbox for images and set paths for overriding the templates of that extension.

Setting definition

Settings definitions are used to set values that can be used in the TypoScript setup through out the project. Before they were kept in the file constants.typoscript. Since TYPO3 v13 they can be stored in the file settings.definitions.yaml. See settings.definitions.yaml in Github.

It is best practise to use them for values that might want to be changed later on like paths, ids of important pages (contact, imprint, a system folder that contains certain records, ...).