If you want to render properties of a main parent of a document dynamically according to the current path, you can’t use standard path expressions. However there is a simple workaround for that:
{%
path = CurrentDocument.NodeAliasPath.Split("/");
return Documents["/" path[1]].DocumentName;
#% }
Please remove the space in this expression: #% } at the end of sample code.
-jh-