将自定义类添加到body标签| TYPO3
问题描述:
我想为每个页面添加自定义类到我想要的身体标记,例如:对于标记页类<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我想要什么
答
鉴于您使用“页面”的Typo脚本ContentObject PAGE,有两个不同的页面树,这与页ID是10和20开始,你可以用以下的TypoScript设置/配置:
[PIDinRootline=10]
page.bodyTagAdd = class="foo"
[end]
[PIDinRootline=20]
page.bodyTagAdd = class="bar"
[end]
https://docs.typo3.org/typo3cms/TyposcriptReference/Setup/Page/Index.html#bodytagadd – jokumer
谢谢你,但我真的在Typo脚本新,所以这个链接对我来说是无法使用的,我需要一些例子来了解它的工作原理! – AnonymousGE