Skip to content

Commit 4372c0b

Browse files
author
Bernhard Schmitt
committed
Add missing method to Fusion implementation
1 parent a1bd1ab commit 4372c0b

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

Classes/Fusion/PresentationObjectComponentImplementation.php

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,33 @@ protected function getPresentationObject(): ComponentPresentationObjectInterface
6868

6969
return $presentationObject;
7070
}
71+
72+
/**
73+
* Returns the Fusion path to the to-be-wrapped Content Element, if applicable
74+
*
75+
* @return string
76+
*/
77+
public function getContentElementFusionPath(): string
78+
{
79+
$fusionPathSegments = explode('/', $this->path);
80+
$numberOfFusionPathSegments = count($fusionPathSegments);
81+
if (isset($fusionPathSegments[$numberOfFusionPathSegments - 3])
82+
&& $fusionPathSegments[$numberOfFusionPathSegments - 3] === '__meta'
83+
&& isset($fusionPathSegments[$numberOfFusionPathSegments - 2])
84+
&& $fusionPathSegments[$numberOfFusionPathSegments - 2] === 'process') {
85+
86+
// cut off the SHORT processing syntax "__meta/process/contentElementWrapping<Neos.Neos:ContentElementWrapping>"
87+
return implode('/', array_slice($fusionPathSegments, 0, -3));
88+
}
89+
90+
if (isset($fusionPathSegments[$numberOfFusionPathSegments - 4])
91+
&& $fusionPathSegments[$numberOfFusionPathSegments - 4] === '__meta'
92+
&& isset($fusionPathSegments[$numberOfFusionPathSegments - 3])
93+
&& $fusionPathSegments[$numberOfFusionPathSegments - 3] === 'process') {
94+
95+
// cut off the LONG processing syntax "__meta/process/contentElementWrapping/expression<Neos.Neos:ContentElementWrapping>"
96+
return implode('/', array_slice($fusionPathSegments, 0, -4));
97+
}
98+
return $this->path;
99+
}
71100
}

0 commit comments

Comments
 (0)