TYPO3 8.7.22 Navbar CSS设置

问题描述

我使用TYPO3版本8.7.22,尝试通过globalVar使用上传的CSS显示我的网站。目前,我可以在每个页面上看到新的CSS视图。但是,每次更改页面(NavBar)时,都必须在URL中添加参数“?test-css = 1”。

这里是我之前的代码:

[globalVar = GP:test-css > 0]
    page.includeCSS.testStyle = fileadmin/css/customize-test.css
    
[global]

这是我的菜单:

enter image description here

有人可以帮我在使用NavBar时不更改URL中的参数吗?

谢谢。

解决方法

您需要为TYPO3中生成的每个URL自动考虑这个特殊的URL参数。

这可以通过以下方式配置:

config {
    // if you have no other linkVars:
    linkVars = test-css(1)

    // in case you have other linkVars defined:
    linkVars := addToList(test-css(1))
}

请参阅manual


要考虑的小副作用:

如果要避免使用此参数毒害您的缓存,则需要确保使用此参数的页面具有自己的缓存变量。

您已经在此参数上设置了条件:

[globalVar = GP:test-css > 0]
   :
[global]

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...