[SOLVED] Uri resource to parent path


(Bernhard Witz) #1

A simple question. Somehow I couldn’t find the answer in the documentation.

How can I write this dynamically?

<a href="/de/hauptseite.html">Zurück</a>


(Soren Malling) #2

Get the parent document by ${q(node).parent('[instanceof Neos.Neos:Document]') would be the first answer that comes to my mind


(Bastian Waidelich) #3

I assume this is about a Content Element in Neos?!
In this case you can get the parent node via Fusion like Søren wrote and pass it to the view like

parentNode = ${q(documentNode).parent().get(0)}

wrote and then use the Link.NodeViewHelper:

{namespace neos=Neos\Neos\ViewHelpers}
<neos:link.node node="{parentNode}">Zurück</neos:link.node>

(Bernhard Witz) #4

Thank you @bwaidelich for this detailed answer! That’s exactly what I was looking for!