TYPO3 - 在 TypoScript 中使用站点配置 - BaseUrl

问题描述 投票:0回答:2

在 TYPO3 Docu 中我们可以阅读示例:在 TypoScript 中使用站点配置

将 Yaml 站点配置为打字稿。
但此代码示例仅适用于“页面”角落。

page.10 = TEXT
page.10.data = site:base
page.10.wrap = This is your base URL: |

我在 FLUIDTEMPLATE 中使用它:

page {
  10 {
    variables {
      # BaseURL
      siteConfigBase = TEXT
      siteConfigBase {
        data = site:base
      }
   }
}

这工作正常,在 f.debug 中是正确的输出

siteConfigBase = https://example.org

我如何将值传递给

config.baseURL

yaml typo3 typoscript typo3-10.x
2个回答
0
投票

config.baseURL
仅支持字符串,不支持
stdWrap

但是你可以使用条件来得到你想要的:

[site("identifier") == "foo"]
config.baseURL = foo
[global]

标识符是站点配置文件夹的名称。


0
投票

您可以添加此 TypoScript。这会在 head 标签后面添加基本标签。

page.headTag = TEXT
page.headTag.data = site.base
page.headTag.wrap = <head><base href="|">
© www.soinside.com 2019 - 2024. All rights reserved.