public function contentElementAugmentation(JoinPointInterface $joinPoint)
    {
        /** @var NodeInterface $node */
        $node = $joinPoint->getMethodArgument('node');

        if (
            !$this->session->isStarted()
            || $this->session->getData('__neosLegacyUiEnabled__')
            || $node->getContext()->getWorkspace()->isPublicWorkspace()
        ) {
            return $joinPoint->getAdviceChain()->proceed($joinPoint);
        }

        $content = $joinPoint->getMethodArgument('content');

        // Stay compatible with Neos 3.0. When we remove this compatibility, we can convert everything to "fusionPath").
        $fusionPath = ($joinPoint->isMethodArgument('typoScriptPath') ? $joinPoint->getMethodArgument('typoScriptPath') : $joinPoint->getMethodArgument('fusionPath'));

        if (!$this->needsMetadata($node, false)) {
            return $content;
        }

        $attributes = $joinPoint->isMethodArgument('additionalAttributes') ? $joinPoint->getMethodArgument('additionalAttributes') : [];
        $attributes['data-__neos-node-contextpath'] = $node->getContextPath();
        $attributes['data-__neos-fusion-path'] = $fusionPath;

        $this->renderedNodes[] = $node->getIdentifier();

        $this->userLocaleService->switchToUILocale();

        $serializedNode = json_encode($this->nodeInfoHelper->renderNodeWithPropertiesAndChildrenInformation($node, $this->controllerContext));

        $this->userLocaleService->switchToUILocale(true);

        $wrappedContent = $this->htmlAugmenter->addAttributes($content, $attributes, 'div');
        $wrappedContent .= "<script data-neos-nodedata>(function(){(this['@Neos.Neos.Ui:Nodes'] = this['@Neos.Neos.Ui:Nodes'] || {})['{$node->getContextPath()}'] = {$serializedNode}})()</script>";

        return $wrappedContent;
    }
public function contentElementAugmentation(JoinPointInterface $joinPoint)
    {
        /** @var NodeInterface $node */
        $node = $joinPoint->getMethodArgument('node');

        if (
            !$this->session->isStarted()
            || $this->session->getData('__neosLegacyUiEnabled__')
            || $node->getContext()->getWorkspace()->isPublicWorkspace()
        ) {
            return $joinPoint->getAdviceChain()->proceed($joinPoint);
        }

        $content = $joinPoint->getMethodArgument('content');

        // Stay compatible with Neos 3.0. When we remove this compatibility, we can convert everything to "fusionPath").
        $fusionPath = ($joinPoint->isMethodArgument('typoScriptPath') ? $joinPoint->getMethodArgument('typoScriptPath') : $joinPoint->getMethodArgument('fusionPath'));

        if (!$this->needsMetadata($node, false)) {
            return $content;
        }

        $attributes = $joinPoint->isMethodArgument('additionalAttributes') ? $joinPoint->getMethodArgument('additionalAttributes') : [];
        $attributes['data-__neos-node-contextpath'] = $node->getContextPath();
        $attributes['data-__neos-fusion-path'] = $fusionPath;

        $this->renderedNodes[] = $node->getIdentifier();

        $this->userLocaleService->switchToUILocale();

        $serializedNode = json_encode($this->nodeInfoHelper->renderNodeWithPropertiesAndChildrenInformation($node, $this->controllerContext));

        $this->userLocaleService->switchToUILocale(true);

        $wrappedContent = $this->htmlAugmenter->addAttributes($content, $attributes, 'div');
        $wrappedContent .= "<script data-neos-nodedata>(function(){(this['@Neos.Neos.Ui:Nodes'] = this['@Neos.Neos.Ui:Nodes'] || {})['{$node->getContextPath()}'] = {$serializedNode}})()</script>";

        return $wrappedContent;
    }
public function contentElementAugmentation ( JoinPointInterface $ joinPoint ) { /** @var NodeInterface $node */ $ node = $ joinPoint -> getMethodArgument ( 'node' ) ; if ( ! $ this -> session -> isStarted ( ) || $ this -> session -> getData ( '__neosLegacyUiEnabled__' ) || $ node -> getContext ( ) -> getWorkspace ( ) -> isPublicWorkspace ( ) ) { return $ joinPoint -> getAdviceChain ( ) -> proceed ( $ joinPoint ) ; } $ content = $ joinPoint -> getMethodArgument ( 'content' ) ; // Stay compatible with Neos 3.0. When we remove this compatibility, we can convert everything to "fusionPath"). $ fusionPath = ( $ joinPoint -> isMethodArgument ( 'typoScriptPath' ) ? $ joinPoint -> getMethodArgument ( 'typoScriptPath' ) : $ joinPoint -> getMethodArgument ( 'fusionPath' ) ) ; if ( ! $ this -> needsMetadata ( $ node , false ) ) { return $ content ; } $ attributes = $ joinPoint -> isMethodArgument ( 'additionalAttributes' ) ? $ joinPoint -> getMethodArgument ( 'additionalAttributes' ) : [ ] ; $ attributes [ 'data-__neos-node-contextpath' ] = $ node -> getContextPath ( ) ; $ attributes [ 'data-__neos-fusion-path' ] = $ fusionPath ; $ this -> renderedNodes [ ] = $ node -> getIdentifier ( ) ; $ this -> userLocaleService -> switchToUILocale ( ) ; $ serializedNode = json_encode ( $ this -> nodeInfoHelper -> renderNodeWithPropertiesAndChildrenInformation ( $ node , $ this -> controllerContext ) ) ; $ this -> userLocaleService -> switchToUILocale ( true ) ; $ wrappedContent = $ this -> htmlAugmenter -> addAttributes ( $ content , $ attributes , 'div' ) ; $ wrappedContent .= "<script data-neos-nodedata>(function(){(this['@Neos.Neos.Ui:Nodes'] = this['@Neos.Neos.Ui:Nodes'] || {})['{$node->getContextPath()}'] = {$serializedNode}})()</script>" ; return $ wrappedContent ; }
Hooks into standard content element wrapping to render those attributes needed for the package to identify
nodes and Fusion paths

@Flow\Around("method(Neos\Neos\Service\ContentElementWrappingService->wrapContentObject())")
@param JoinPointInterface $joinPoint the join point
@return mixed
Hooks into standard content element wrapping to render those attributes needed for the package to identify nodes and Fusion paths