Get Parent Document Name in transformation

Conor Dunk asked on August 15, 2016 14:59

Hi, i'm very new to Kentico so apologises if this is basic. I'm trying to get the document name of the parent page in a hierarchical transformation, currently i'm trying to use:

{% CurrentDocument.Parent.DocumentName %}

All I seem to return is "(root)"?

Thank you in advance for any help. Conor

Correct Answer

Anton Grekhovodov answered on August 15, 2016 15:37

Hi Conor,

It returns the name of parent for your node where you placed a control.

If you want to get a parent node name for current item in repeater, try to use this code in your transformation:{% Documents[NodeAliasPath].Parent.DocumentName |(identity)GlobalAdministrator%}

4 votesVote for this answer Unmark Correct answer

Recent Answers

Zach Perry answered on August 15, 2016 15:35 (last edited on December 10, 2019 02:30)

{% CurrentDocument.Parent.DocumentName |(identity)GlobalAdministrator%} Will return the parent name of whichever page the web part is on. Are you trying to get the parent name of the item in the query?

0 votesVote for this answer Mark as a Correct answer

David te Kloese answered on August 15, 2016 15:43

As mentioned above CurrentDocument is the page your webpart is placed upon. Not the data item you're listing in your hierarchical view.

Can't you just start the hierarchical viewer one level higher? If this doesn't fit your markup you could determine the place to start the subitems of an item using the following:

ASCX transformations:

<cms:SubLevelPlaceHolder runat="server" ID="plcSub" />

Text transformations:


More info:

0 votesVote for this answer Mark as a Correct answer

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