How do you render properties of a document from the first level of the current path?

HelenaG Grulichova asked on November 1, 2012 09:29

How do you render properties of a document from the first level of the current path?

Correct Answer

HelenaG Grulichova answered on November 1, 2012 09:29

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-
0 votesVote for this answer Unmark Correct answer

   Please, sign in to be able to submit a new answer.