fanor51/headless-container-support

为TYPO3 Headless扩展添加容器支持的扩展

安装次数: 19,850

依赖者: 0

建议者: 0

安全: 0

星标: 11

关注者: 6

分支: 4

开放问题: 0

类型:typo3-cms-extension

3.1.1 2024-02-08 10:24 UTC

README

安装

像安装其他扩展一样安装

  • Composer: composer require fanor51/headless-container-support

使用

查看Example/TypoScript/Container/50_wrapper.typoscript,其中有一个如何配置容器的示例。这里特别的是,我们向配置中添加了一个“新”的数据处理器,该处理器主要来自容器扩展。只在最后添加了一些内容

之后,您需要使用where子句覆盖标准的lib.content对象,以排除来自容器扩展的“特殊”colPos

# PRELOAD EXTENSIONS SETTINGS
@import 'EXT:headless/Configuration/TypoScript/'

# Overwrite the default lib.content from the headless extension with added colPos where in YOUR Config Extension
# Add the colPos IDS from your Container Configuration to the where
lib.content = CONTENT_JSON
lib.content {
  table = tt_content
  select {
    orderBy = sorting
    where = colPos NOT IN (201,202,203)
  }
}

在这个例子中,我们使用colPoses 201、202和203作为容器内容,这些内容已在容器配置下的Configuration/TCA/Overrides/tt_content.php中设置。您可以在此找到此示例:Example/TCA/Overrides/tt_content.php

最终应如下所示

image description

完整的json示例在:Docs/Json/Example.json

自定义

您可以根据需要或希望的方式自定义与TYPOSCRIPT中的colPos等效的名称。

image description

鸣谢

该扩展的开发得到了TYPO3代理商brandung GmbH的支持。