AnonymousGE
AnonymousGE

Reputation: 51

Add custom class to body tag | TYPO3

I want to add custom class to body tag to each page what I want, for example: for Tag pages class <body class="tagClass">, for main page class <body class="mainClass"> and for detailed pages <body class="classDetailed">.

I`m using TYPO3 7.6.0 andi have installed on it Blog extention, this blog extention pages i want this classes.

some examples or link would be very helpful for me.

By the way this post i saw TYPO3 Adding a class to the body tag on a specifc page but it isn`t what i want

Upvotes: 1

Views: 2853

Answers (1)

jokumer
jokumer

Reputation: 2269

Given you are using 'page' as TypoScript ContentObject PAGE and have two different page trees, which starts with page id 10 and 20, you can use following TypoScript setup/configuration:

[PIDinRootline=10]
    page.bodyTagAdd = class="foo"
[end]

[PIDinRootline=20]
    page.bodyTagAdd = class="bar"
[end]

Upvotes: 2

Related Questions