How to use a site setting of type bool in typoscript

It is practically impossible to handle a bool-setting in typoscript. I tried 5 variants with and without the help of AI and i can not pass a “flag” variable, that holds “1” or “0” based on a sitesetting, that may or may not exist for the current site.

I don’t want to use a typoscript condition because i don’t like it, when the logic is not in one place

What i tried

foo = TEXT
foo {
value = 1
override = 0
override.if.isTrue.data = sitesettings:some.setting.that.can.be.FALSE
}

I tried ith with/without stdWra and tried a CASE object. Nothing works.

How would you do this?

Use ifFalse if — TypoScript Explained main documentation

if.isFalse.data = <site setting>

And then followed by a “negate”

What is your need? Pass a value to something?

Btw, if you just need to pass the value (checked or not) go for

value = TEXT
value.data = siteSettings : settings_key

Found a real life example “shaped” to your description

        backgroundColor = TEXT
        backgroundColor.value = color-7
        backgroundColor.value {
            override.field = tx_theme_color
            override.if.isTrue.field = tx_theme_color
        }

So in your case, something similar would be

flag = TEXT
flag {
  value = true
  value.override {
    if.isFalse.data = siteSettings : settings_key
    value = false
  }
}