[英]TYPO3 - multiple pages via TypoScript
I have a HTML Template which looks like the following: 我有一个HTML模板,如下所示:
<div class="container container-settings">
###INHALT###
</div>
Now I want to add this template to more pages in TYPO3 and then insert content depending on the page via only one TypoScript file. 现在,我想将此模板添加到TYPO3的更多页面中,然后仅通过一个TypoScript文件根据页面插入内容。
For example I want to to be shown the content on my page "page1" and "page2" as follows: 例如,我想在页面“ page1”和“ page2”上显示如下内容:
marks {
===> if content from page1
INHALT < styles.content.get
INHALT.select.where = colPos=3
INHALT.renderObj.stdWrap.wrap=<div class="styled-box">|</div>
===> if content from page2
INHALT < styles.content.get
INHALT.select.where = colPos=5
INHALT.renderObj.stdWrap.wrap=<div class="different-style">|</div>
}
Is there a way to achieve this? 有没有办法做到这一点?
Thanks allready! 谢谢大家!
UPDATE 更新
@nbar I updated the config as follows: @nbar我更新了配置,如下所示:
10 = TEMPLATE
10 {
template = FILE
template.file = fileadmin/layout_subsites.html
workOnSubpart = DOKUMENT
marks {
[globalVar = TSFE:id=3]
INHALT < styles.content.get
INHALT.select.where = colPos=2
[global]
[globalVar = TSFE:id=4]
INHALT < styles.content.get
INHALT.select.where = colPos=0
[global]
[globalVar = TSFE:id=5]
INHALT < styles.content.get
INHALT.select.where = colPos=0
INHALT.renderObj.stdWrap.wrap=<div class="different-style">|</div>
[global]
}
}
However, this doesn't work as i want it to. 但是,这不起作用,因为我想要它。 Am I making a big mistake, i guess? 我猜我犯了个大错误吗?
Here is an example how "IF"-Statements works in Typoscript. 这是一个示例,“ IF”语句如何在Typoscript中工作。 The typoscript gets executed when the ID of the page fits. 当页面ID合适时,便会执行排印。
I just copied the code inside the "IF"-Statement from your originalpost, so my example is just for the Conndition, not for the other code. 我只是从原始帖子中复制了“ IF” -Statement中的代码,所以我的示例仅适用于Conndition,而不适用于其他代码。
[globalVar = TSFE:id=1]
marks.INHALT < styles.content.get
marks.INHALT.select.where = colPos=3
marks.INHALT.renderObj.stdWrap.wrap=<div class="styled-box">|</div>
[global]
[globalVar = TSFE:id=2]
marks.INHALT < styles.content.get
marks.INHALT.select.where = colPos=5
marks.INHALT.renderObj.stdWrap.wrap=<div class="different-style">|</div>
[global]
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.