[英]Neos CMS error when placing content to page
最近在 Neos CMS 中,当我在页面中使用内容元素时出现此错误。
An exception was thrown while Neos tried to render your page
The Fusion object `Company.Corp:Content.ContactUsPage` cannot be rendered: Most likely you
mistyped the prototype name or did not define the Fusion prototype with
`prototype(Company.Corp:Content.ContactUsPage) < prototype ...` . Other possible reasons are a
missing parent-prototype or a missing `@class` annotation for prototypes without parent. It is
also possible your Fusion file is not read because of a missing `include:` statement.
但我认为我的 Node 和 Fusion 文件是正确的,没有任何错误。 但也许我错了。 你能帮我解决这个错误吗? 我是初学者。
这是我来自名为NodeTypes.Content.ContactUsPage.yaml的节点文件的代码:
'Company.Corp:Content.ContactUsPage':
superTypes:
'Neos.Neos:Content': true
ui:
label: 'Contact Us Page'
icon: icon-file-text
inlineEditable: true
inspector:
groups:
showCases:
label: 'Contact Us Page Data'
icon: icon-file-text
position: 5
properties:
smallTitle:
type: string
defaultValue: ''
ui:
label: 'Small Title'
inspector:
group: 'contactUsPage'
editorOptions:
placeholder: ''
maxlength: 300
这是我的名为ContactUsPage.fusion的融合文件:
prototype(Company.Corp:Content.ContactUsPage) < prototype(Neos.Neos:ContentComponent) {
smallTitle = Neos.Neos:Editable {
property = 'smallTitle'
}
renderer = afx`
<div id="contact" class="row mt-5">
<div class="col-lg-6">
<div class="contact-caption">
<div class="section-title mt-5">
<div class="upTitle">{props.smallTitle}</div>
</div>
</div>
</div>
</div>
`
}
将您的 Fusion 文件重命名为“Content.ContactUsPage.fusion”,您应该没问题。
或者
或者,您可以将 your.yaml 中的 line1 重写为:Company.Corp:ContactUsPage':
两者都应该工作融合文件的命名需要等同于您的 yaml 中的第一行。如果您将 go 用于“Content.foo”,您的融合也需要命名为“Content.Foo.fusion”。
希望有帮助
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.