[TYPO3-english] Add ID to body tag depends on DB value

Stefano Kowalke blueduck at gmx.net
Tue Mar 20 12:51:42 CET 2012


Hey,

thanks you all for you help. It works now as expected. For the
completeness and for others with the same question I post my code here:

page.bodyTagCObject = COA
page.bodyTagCObject {
  10 = CONTENT
  10 {
    table = tx_cagrelatedcontent_category
    select {
      pidInList = 14
      selectFields = tx_cagrelatedcontent_category.uid
      join = pages_tx_cagrelatedcontent_category_mm
      where = tx_cagrelatedcontent_category.uid =
pages_tx_cagrelatedcontent_category_mm.uid_foreign
      andWhere = pages_tx_cagrelatedcontent_category_mm.uid_local =
{page:uid}
      andWhere.insertData = 1
      max = 1
    }

    renderObj = CASE
    renderObj {
      key.field = uid

      default = TEXT
      default.value = <body>

      1 = TEXT
      1.value = <body class="name_of_category_1">

      2 = TEXT
      2.value = <body class="name_of_category_2">

      3 = TEXT
      3.value = <body class="name_of_category_3">
    }
  }
}

Regards
Stefano


More information about the TYPO3-english mailing list