【问题标题】:How to convert nodes to uris in TYPO3 Neos如何在 TYPO3 Neos 中将节点转换为 uris
【发布时间】:2015-02-25 11:21:14
【问题描述】:

我在 TYPO3 Neos 1.2.1 中创建了一个带有链接字段的自定义节点类型。当我将属性值传递给模板并尝试将其呈现为链接时,会抛出一个 execption:

Paths must not contain two consecutive slashes.

链接属性值为 »node://c969f0d4-2e01-87b9-25a8-6079c5a292fe«。 I have read,必须先将链接转换为 URI。但是,建议的处理器对我的网站没有影响。

TypoScript2

prototype(Acme.MySitePackage:Teaser) < prototype(TYPO3.Neos:Content) {
    templatePath = 'resource://Acme.MySitePackage/Private/Templates/NodeTypes/Teaser.html'

    title = ${q(node).property('title')}
    text = ${q(node).property('text')}
    image = ${q(node).property('image')}
    link = ${q(node).property('link')}
    link.@process.convertUris = TYPO3.Neos:ConvertUris {
        #forceConversion = true
    }
}

流体模板

<f:debug>{link}</f:debug>
<neos:link.node node="{link}" />

【问题讨论】:

    标签: typo3 neoscms


    【解决方案1】:

    我敢打赌,如果您保留处理器并从模板中删除 neos:link.node,那么

    <f:debug>{link}</f:debug>
    

    将显示指向该节点的 http:// 链接。 错误发生在链接 ViewHelper 上,它需要一个节点或节点路径,但既不是 node:// 也不是 href:// 链接(也许我们将来应该支持它)。所以你可以使用普通的&lt;a href="{link}"&gt;

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-06-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-07-17
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多