blackplan
blackplan

Reputation: 276

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. Currently I can see every page with the new CSS view. But every time I change a page (NavBar) I have to add the parameter "?test-css=1" to the URL.

Here with my previous code:

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

This is my menu: enter image description here

Can someone help me to not change the parameter in the URL when using NavBar?

Thanks in advance.

Upvotes: 0

Views: 80

Answers (1)

Bernd Wilke πφ
Bernd Wilke πφ

Reputation: 10791

What you need is an automatic consideration of this special URL parameter for each URL generated in TYPO3.

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]

Upvotes: 1

Related Questions