简体   繁体   中英

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? Can I replace Typoscript objects within a specific path?

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). Generally TypoScript paths are up to you and you can configure any TypoScript path you like. It is a configuration, just like YAML for example. 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). 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". But TypoScript doesn't prevent you from setting other properties:

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. This allows you to chain expressions and TypoScript object output together by using this kind of "self defined" paths.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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