【问题标题】:tx_news n:link don't want build absolute link with config.absPrefixtx_news n:link 不想用 config.absPrefix 建立绝对链接
【发布时间】:2019-01-14 12:43:54
【问题描述】:

在 tx_news 模板中,我们有 <n:link 跟随 <f:link.typolink 似乎我们可以使用 configuration="{forceAbsoluteUrl: 1}" 并得到

<h3>
  <n:link configuration="{forceAbsoluteUrl: 1}" newsItem="{newsItem}" settings="{settings}" title="{newsItem.title}">
    <span itemprop="headline">{newsItem.title}</span>
  </n:link>
</h3>

对于构建绝对链接 TYPO3 使用 config.absPrefix 但在 TYPO3 9.5.3 中无效。我可以在站点Configuration -&gt; Entry Point 中更改此设置。但不是更多的打字稿。

我已经检查过了。此排版设置在 TYPO3 9.5.3 中仍然可用。但看起来只适用于资产(标题中的脚本/样式)而不适用于链接?我可以解决吗?

最后我需要来自config.absPrefix 或其他打字稿的 tx_news 中的绝对链接,但不是 config.yaml

【问题讨论】:

    标签: tx-news typo3-9.x


    【解决方案1】:

    尝试使用config.absRefPrefix 而不是config.absPrefix

    【讨论】:

      【解决方案2】:

      typo3 v9.5.x 中没有一种解决方案不能在 TYPO3 v9.5.x 中使用,所以我必须使用 Site manager Variants

      rootPageId: 1
      base: www.livedomain.com
      baseVariants:
        -
          base: 'http://localhost'
          condition: 'applicationContext == "Development"'
        -
          base: 'https://stagedomain.com'
          condition: 'applicationContext == "Testing"'
      

      在我的 apache2 或 .htaccess 中

      SetEnv TYPO3_CONTEXT Development
      

      SetEnv TYPO3_CONTEXT Testing
      

      如果上下文未设置网站,则在其他情况下使用 baseVariants 中的基本 url

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2011-02-21
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多