From 562d152e4bda917b94865341ec6694d2f1e9bf88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anke=20H=C3=A4slich?= Date: Mon, 6 Nov 2023 08:45:54 +0100 Subject: [PATCH] BUGFIX: Neos.NodeTypes:Text prototype is now a ContentComponent The NodeType fusion renderer is now pure fusion, the behavior including attributes is kept. Relates: #4537 Relates: #4705 --- .../Private/Fusion/Content/Text.fusion | 25 ++++++++++++++++--- .../Private/Templates/NodeTypes/Text.html | 4 --- 2 files changed, 21 insertions(+), 8 deletions(-) delete mode 100644 Neos.NodeTypes/Resources/Private/Templates/NodeTypes/Text.html diff --git a/Neos.NodeTypes/Resources/Private/Fusion/Content/Text.fusion b/Neos.NodeTypes/Resources/Private/Fusion/Content/Text.fusion index dbe9dc1d3d9..a89744272ef 100644 --- a/Neos.NodeTypes/Resources/Private/Fusion/Content/Text.fusion +++ b/Neos.NodeTypes/Resources/Private/Fusion/Content/Text.fusion @@ -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")} - text.@process.convertUris = 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) { + # attributes.class.@process.nodeType > + # } + # in your site's Fusion if you don't need that behavior. + attributes.class.@process.nodeType = ${Array.push(value, String.toLowerCase(String.pregReplace(node.nodeTypeName.value, '/[[:^alnum:]]/', '-')))} + + renderer = afx` +
+ {props.text} +
+ ` } diff --git a/Neos.NodeTypes/Resources/Private/Templates/NodeTypes/Text.html b/Neos.NodeTypes/Resources/Private/Templates/NodeTypes/Text.html deleted file mode 100644 index 6bb9ab48a87..00000000000 --- a/Neos.NodeTypes/Resources/Private/Templates/NodeTypes/Text.html +++ /dev/null @@ -1,4 +0,0 @@ -{namespace neos=Neos\Neos\ViewHelpers} - f:format.raw()}> - {neos:contentElement.editable(property: 'text')} - \ No newline at end of file