本文介绍了TYPO3:TypoScript中的后端布局条件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 我想根据页面的后端布局更改元素的呈现方式。 根据后端布局更改可变样式的内容模板,如下所示:I'd like to change the way elements are rendered depending on the page's backend layout.Changing the fluid styled content template depending on the backend layout works as following:[globalVar = TSFE:page|backend_layout = 1][globalVar = TSFE:page|backend_layout = 2]lib.fluidContent.templateRootPaths.10 = EXT:ds_res/Resources/Private/Templates/ContentTemplates/[global]如果它是1或2,然后使用其他模板。If it's 1 or 2, then use the other templates. 但是,仅当BE布局直接设置在页面上且 如何解决此问题?However, this only works if the BE layout is set directly at the page and not when it's inherited from its parent.How to fix this?运行TYPO3 7.6.15 谢谢。Running TYPO3 7.6.15Thanks.推荐答案在TYPO3 7.5中,后端布局-在Typoscript中使用 pagelayout进行了简化。示例:In TYPO3 7.5 "Backend Layout"-Conditions has been simplified with "pagelayout" in Typoscript. Example:page.10 = FLUIDTEMPLATEpage.10 { file.stdWrap.cObject = CASE file.stdWrap.cObject { key.data = pagelayout default = TEXT default.value = EXT:sitepackage/Resources/Private/Templates/Home.html 3 = TEXT 3.value = EXT:sitepackage/Resources/Private/Templates/1-col.html 4 = TEXT 4.value = EXT:sitepackage/Resources/Private/Templates/2-col.html }}而不是:field = backend_layoutifEmpty.data = levelfield:-2,backend_layout_next_level,slideifEmpty.ifEmpty = default也许在您这样的条件下也可以使用:Maybe this also works in your conditions like this:[globalVar = TSFE:page|pagelayout = 1]但是,您应该不要使用[xy]-条件更改已使用的模板文件,而应该使用上面示例中显示的CASE。顺便说一下,每个数字都是 backend_layout 的UID。However, you should not change the used template file with [xy]-conditions and prefer using a CASE shown in the example above. Each number is the UID of a backend_layout by the way. 这篇关于TYPO3:TypoScript中的后端布局条件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-23 04:52