Skip to content

Commit

Permalink
BUGFIX: Neos.NodeTypes:Text prototype is now a ContentComponent
Browse files Browse the repository at this point in the history
The NodeType fusion renderer is now pure fusion, the behavior including attributes is kept.

Relates: neos#4537
Relates: neos#4705
  • Loading branch information
ahaeslich committed Nov 6, 2023
1 parent a9a608b commit 562d152
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 8 deletions.
25 changes: 21 additions & 4 deletions Neos.NodeTypes/Resources/Private/Fusion/Content/Text.fusion
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
prototype(Neos.NodeTypes:Text) < prototype(Neos.Neos:Content) {
templatePath = 'resource://Neos.NodeTypes/Private/Templates/NodeTypes/Text.html'
text = ${q(node).property("text")}
[email protected] = Neos.Neos:ConvertUris
prototype(Neos.NodeTypes:Text) < prototype(Neos.Neos:ContentComponent) {
text = Neos.Neos:Editable {
property = 'text'
}

attributes = Neos.Fusion:DataStructure
attributes.class = ''
# The following is used to automatically append a class attribute that reflects the underlying node type of a Fusion object,
# for example "neos-nodetypes-form", "neos-nodetypes-headline", "neos-nodetypes-html", "neos-nodetypes-image", "neos-nodetypes-menu" and "neos-nodetypes-text"
# You can disable the following line with:
# prototype(Neos.NodeTypes:Text) {
# [email protected] >
# }
# in your site's Fusion if you don't need that behavior.
[email protected] = ${Array.push(value, String.toLowerCase(String.pregReplace(node.nodeTypeName.value, '/[[:^alnum:]]/', '-')))}

renderer = afx`
<div {...props.attributes}>
{props.text}
</div>
`
}

This file was deleted.

0 comments on commit 562d152

Please sign in to comment.