【发布时间】:2022-01-19 18:30:43
【问题描述】:
最近在 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 文件是正确的,没有任何错误。但也许我错了。你能帮我解决这个错误吗?我是这方面的初学者。
这是我的 Node 文件中的代码 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>
`
}
【问题讨论】: