Issue with macro

lawrence whittemore asked on June 16, 2016 19:03

I am trying to use this macro {%CurrentDocument.Parent.MenuPath#%} to pull a field from a document. This works {%CurrentDocument.MenuPath#%} to pull the current document's field but the previous does not. Am I missing something?

Recent Answers


Joshua Adams answered on June 16, 2016 19:27

Where are you trying to use this macro? In a transformation or somewhere else?

0 votesVote for this answer Mark as a Correct answer

lawrence whittemore answered on June 16, 2016 20:31

In a webpart.

0 votesVote for this answer Mark as a Correct answer

Jan Hermann answered on June 16, 2016 22:09 (last edited on December 10, 2019 02:30)

Please try this one instead:

{%Documents.WithAllData[CurrentDocument.Parent.NodeAliasPath].GetValue("MenuPath")|(identity)GlobalAdministrator%}
2 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on June 17, 2016 19:32 (last edited on December 10, 2019 02:30)

Jan, does he have to run the full query to get just that value? Or is it because its a custom field you need to to that? I'd think you could use

{%CurrentDocument.Parent.GetValue("MenuPath")|(identity)GlobalAdministrator%}

If it was a out of the box field.

0 votesVote for this answer Mark as a Correct answer

Jan Hermann answered on June 18, 2016 08:39

@Brenden: I haven't noticed the v9 tag in original post. Yes, your macro is correct and working. The one I sent is more general one and should work across all supported versions of Kentico.

0 votesVote for this answer Mark as a Correct answer

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