public function render(NodeInterface $node)
{
$documentNodes = [];
$flowQuery = new FlowQuery(array($node));
$nodes = array_reverse($flowQuery->parents('[instanceof Neos.Neos:Document]')->get());
/** @var NodeInterface $node */
foreach ($nodes as $documentNode) {
$documentNodes[] = $documentNode;
}
if ($node->getNodeType()->isOfType('Neos.Neos:Document')) {
$documentNodes[] = $node;
}
$this->templateVariableContainer->add('documentNodes', $documentNodes);
$content = $this->renderChildren();
$this->templateVariableContainer->remove('documentNodes');
return $content;
}