Tim
Tim

Reputation: 6441

Setting the body class by a page ancestor

I know how to set the body class dynamically using the current page uid:

page.bodyTagCObject = HTML
page.bodyTagCObject.value.field = uid
page.bodyTagCObject.value.wrap = <body id="uid|">

But how can I set the body class using the id of the top-level ancestor of a page?

Thanks!

Upvotes: 0

Views: 862

Answers (1)

Krystian Szymukowicz
Krystian Szymukowicz

Reputation: 1488

Check this one:

page.bodyTagCObject = HTML
page.bodyTagCObject.value.dataWrap = <body id="uid{leveluid:0}">

You can read about way of getting such data here: http://typo3.org/documentation/document-library/core-documentation/doc_core_tsref/4.7.0/view/2/2/

Find text "getText"

Upvotes: 1

Related Questions