TYPO3 V9:具有绝对路径的站点配置?

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

我想将我的站点配置为类似于TYPO3以前版本中的config.absRefPrefix行为。

在使用config.absRefPrefix = https://www.example.com/进行配置之前,网页上的所有链接都具有绝对路径。现在,使用新的站点配置模块,只有页面顶部和底部的Typoscript生成的链接才具有绝对路径。导航和内容部分中的链接始终是相对的。

有人知道如何将站点配置为具有与以前的TYPO3版本相同的行为吗?

typo3 typo3-9.x
1个回答
0
投票

如果要在TYPO3 9或10中使用绝对URL,一种方法可能是Typolink Fluid ViewHelper的新“ absolute”属性:

https://docs.typo3.org/m/typo3/reference-typoscript/master/en-us/Functions/Typolink.html#forceabsoluteurl

我已经在我的网站上对此进行了快速测试,非常适合我的徽标。

对于导航:如果使用TYPO3 MenuProcessor和Fluid来创建菜单,则还可以使用absolute =“ true”属性。我也对此进行了测试,效果很好。

对于内容元素,这些设置对我来说适用于9.5.11甚至是版本10:

// parseFunc
lib.parseFunc.tags.a.typolink.forceAbsoluteUrl = 1
lib.parseFunc.tags.link.typolink.forceAbsoluteUrl = 1
lib.parseFunc.tags.a.typolink.forceAbsoluteUrl.scheme = https
lib.parseFunc.tags.link.typolink.forceAbsoluteUrl.scheme = https

// parseFunc_RTE
lib.parseFunc_RTE.tags.a.typolink.forceAbsoluteUrl = 1
lib.parseFunc_RTE.tags.link.typolink.forceAbsoluteUrl = 1
lib.parseFunc_RTE.tags.a.typolink.forceAbsoluteUrl.scheme = https
lib.parseFunc_RTE.tags.link.typolink.forceAbsoluteUrl.scheme = https

我已经测试了所有内容,并且现在在这里拥有完整的“绝对URL网站”。

© www.soinside.com 2019 - 2024. All rights reserved.