TypoScript if - Show content on specific pages

Examples how to use the TypoScript if functions

Examples

You want to show content on specific pages and exclude for example pages like the start page? Here are some examples.

 

Show text on all pages but 1,6,7,8 and 23:

 

page.10 {
  variables {
    someStuff = TEXT
    someStuff {
      value = Hello world
      if {
        value = 1,6,7,8,23
        isInList.field = uid
        negate = 1
      }
    }
  }
}

 

Show text only on page 2,10 and 14:

 

page.10 {
  variables {
    someStuff = TEXT
    someStuff {
      value = Hello world
      if {
        value = 2,10,14
        isInList.field = uid
      }
    }
  }
}