Shared Partials

Sometimes you want to reuse Partials from your extension in your Content Block template. This is done by extending the partialRootPaths of the default Content Block FLUIDTEMPLATE definition.

For every Content Block

EXT:site_package/Configuration/TypoScript/setup.typoscript
lib.contentBlock {
    partialRootPaths {
        100 = EXT:site_package/Resources/Private/Partials/ContentElements/
    }
}
Copied!

For a specific Content Block

EXT:site_package/Configuration/TypoScript/setup.typoscript
tt_content.myvendor_mycontentblockname {
    partialRootPaths {
        100 = EXT:my_sitepackage/Resources/Private/Partials/ContentElements/
    }
}
Copied!

For all EditorPreview.html templates

Sometimes it is needed to include partials from another source to be used in the preview. For this some Page TsConfig is needed. This can be included in the page.tsconfig file inside your extension, which is automatically loaded. It is also possible to provide additional layout root paths.

EXT:my_extension/Configuration/page.tsconfig
tx_content_blocks {
  view {
    layoutRootPaths {
      10 = EXT:my_extension/Resources/Private/Layouts/
    }
    partialRootPaths {
      10 = EXT:my_extension/Resources/Private/Partials/
    }
  }
}
Copied!