Reputation: 35
recently in Neos CMS, I got this error when i used content element in page.
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.
But I think my Node and Fusion file are correct without any mistake. But maybe Im wrong. Could you please help me with solve this error? Im beginner in this.
Here is my code from Node file called 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
And here is my fusion file called 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>
`
}
Upvotes: 0
Views: 460
Reputation: 36
re-name your Fusion file to "Content.ContactUsPage.fusion" and you should be fine.
OR
Alternatively, you could re-write line1 in your .yaml to: Company.Corp:ContactUsPage':
both should work The naming of the fusion file needs to be equivalent to the first line in your yaml. if you go for "Content.foo" your Fusion needs to be named "Content.Foo.fusion" as well.
hope that helps
Upvotes: 0