简体   繁体   English

TYPO3 8.7.22 导航栏 CSS 设置

[英]TYPO3 8.7.22 Navbar CSS setup

I use TYPO3 Version 8.7.22 where I try to display my website with an uploaded CSS via globalVar.我使用 TYPO3 版本 8.7.22,我尝试通过 globalVar 使用上传的 CSS 显示我的网站。 Currently I can see every page with the new CSS view.目前,我可以使用新的 CSS 视图查看每个页面。 But every time I change a page (NavBar) I have to add the parameter "?test-css=1" to the URL.但是每次更改页面(NavBar)时,我都必须在 URL 中添加参数“?test-css=1”。

Here with my previous code:这是我以前的代码:

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

This is my menu:这是我的菜单: 在此处输入图片说明

Can someone help me to not change the parameter in the URL when using NavBar?有人可以帮助我在使用 NavBar 时不更改 URL 中的参数吗?

Thanks in advance.提前致谢。

What you need is an automatic consideration of this special URL parameter for each URL generated in TYPO3.您需要的是为 TYPO3 中生成的每个 URL 自动考虑这个特殊的 URL 参数。

this can be configured with:这可以配置为:

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

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

see manual手册


small side effect to consider:需要考虑的小副作用:

If you want to avoid poisoning your cache with this parameter, you need to make sure that there is an own cache-variant for pages with this parameter.如果您想避免使用此参数使缓存中毒,则需要确保具有此参数的页面有自己的缓存变体。

This you already have done with a condition on this parameter:您已经使用此参数的条件完成了此操作:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM