2017-07-26 114 views
0

我想为每个页面添加自定义类到我想要的身体标记,例如:对于标记页类<body class="tagClass">,对于主页类<body class="mainClass">和对于详细页<body class="classDetailed">将自定义类添加到body标签| TYPO3

我使用TYPO3 7.6.0 andi已经安装了博客扩展,这个博客扩展页面我想要这个类。

一些例子或链接对我来说会很有帮助。

通过这个帖子我看到TYPO3 Adding a class to the body tag on a specifc page的方式,但它isn`t我想要什么

+0

https://docs.typo3.org/typo3cms/TyposcriptReference/Setup/Page/Index.html#bodytagadd – jokumer

+0

谢谢你,但我真的在Typo脚本新,所以这个链接对我来说是无法使用的,我需要一些例子来了解它的工作原理! – AnonymousGE

回答

0

鉴于您使用“页面”的Typo脚本ContentObject PAGE,有两个不同的页面树,这与页ID是10和20开始,你可以用以下的TypoScript设置/配置:

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

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

但我如何确定我在哪个页面,并为此页面设置特定的类名? – AnonymousGE

+0

我会编辑我的答案 – jokumer

+0

非常感谢! – AnonymousGE

相关问题