简体   繁体   English

通过页面祖先设置正文类

[英]Setting the body class by a page ancestor

I know how to set the body class dynamically using the current page uid : 我知道如何使用当前页面uid动态设置body类:

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? 但是,如何使用页面的顶级祖先的ID设置body类?

Thanks! 谢谢!

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/ 您可以在此处阅读有关获取此类数据的方法: http : //typo3.org/documentation/document-library/core-documentation/doc_core_tsref/4.7.0/view/2/2/

Find text "getText" 查找文本“ getText”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM