Is it possible to compare 2 typoscript functions in a condition

63 Views Asked by At

Is it possible to compare the 2 typoscript functions in a condition? If so, what would the syntax be.

site("base").getHost() request.getRequestHostOnly()

Since the following does not seem to work, it seems as it does a string compare but i could be wrong.

[site("base").getHost() == request.getRequestHostOnly()]
page.headerData.850193 = COA
page.headerData.850193 {
  10 = TEXT
  10.wrap (
<script>
!function(f,b,e,v,n,t,s) 
....
)
}
[global]

The case for this is that we only want to load a facebook pixel on valid page visits. TYPO3 also loads the pixel if the site is loaded through a wrapper, like for example translate or other sites.

Any other recommendation would also be welcome.

2

There are 2 best solutions below

0
Siva On BEST ANSWER
0
Jo Hasenau On

Since the result of the condition would be cached, I guess using a TypoScript condition is not a good idea anyway.

Instead you should go for an uncached COA_INT and make use of a nested stdWrap.if condition

page.headerData.850193 = COA_INT
page.headerData.850193 {
  stdWrap.if {
     ...
  }
  10 = COA
  10 {
    stdWrap.if {
       ...
    }
    10 = TEXT
    10 {
      wrap (
        ...
      )
    }
  }
}