简体   繁体   English

什么是TYPO3 Neos的Typoscript路径?

[英]What is a Typoscript path in TYPO3 Neos?

Can someone explain what a Typoscript path really is, and how it is rendered and used within TYPO3 Neos? 有人可以解释一下Typoscript路径到底是什么,以及它是如何在TYPO3 Neos中渲染和使用的? Can I replace Typoscript objects within a specific path? 我可以在特定路径中替换Typoscript对象吗?

Lets have a look at this little snippet: 让我们来看看这个小片段:

page = Page {
    head {
        stylesheets {
            site = TYPO3.TypoScript:Template {
                templatePath = 'resource://TYPO3.NeosDemoTypo3Org/Private/Templates/Page/Default.html'
                sectionName = 'stylesheets'
                node = ${node}
            }
}

Then you have a TypoScript path of "page.head.stylesheets" (left side of the assignments). 然后你有一个TypoScript路径“page.head.stylesheets”(作业的左侧)。 Generally TypoScript paths are up to you and you can configure any TypoScript path you like. 通常TypoScript路径由您决定,您可以配置任何您喜欢的TypoScript路径。 It is a configuration, just like YAML for example. 这是一个配置,就像YAML一样。 Certain paths have a special meaning (like "page" - which is the default entry point for page rendering) and TypoScript objects (like "TYPO3.TypoScript:Template" have certain properties that can be set on their path). 某些路径具有特殊含义(如“页面” - 这是页面呈现的默认入口点)和TypoScript对象(如“TYPO3.TypoScript:Template”具有可在其路径上设置的某些属性)。 You can set any paths you like they just might have no use, but that can be exploited to create special functionality. 您可以设置任何他们可能没用的路径,但可以利用它来创建特殊功能。

Another example: 另一个例子:

foo = TYPO.TypoScript:Value
foo.value = 'test'

Here the path(s) are very visible. 这里的路径非常明显。 The "TYPO.TypoScript:Value" object has only one property "value". “TYPO.TypoScript:Value”对象只有一个属性“value”。 But TypoScript doesn't prevent you from setting other properties: 但TypoScript不会阻止您设置其他属性:

foo = TYPO3.TypoScript:Value {
  bar = ${node.property('title')}
  value = ${'Title: ' + this.bar}
}

bar is not known to the TypoScript object, still you can define it AND you can refer to it by using the "this" variable in an EEL expression. TypoScript对象不知道bar,您仍然可以定义它并且您可以通过在EEL表达式中使用“this”变量来引用它。 This allows you to chain expressions and TypoScript object output together by using this kind of "self defined" paths. 这允许您使用这种“自定义”路径将表达式和TypoScript对象输出链接在一起。

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

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