Convert the Path value of a Web Part to a Document Object or Collection of Document Objects

Jay Heavner asked on March 7, 2016 23:33

I have a Repeater Web Part. It's Path value is set as ./SomeChild/%. In my HTML Envelope I would like to use the DocumentName of the parent of the repeated content; basically the DocumentName of SomeChild.

If I use the macro {% Path %} then it renders ./SomeChild/% but it appears to be text and not an Object. Is there another macro that I can pass that output to in order to get a Document Object or, given that there's a wildcard at the end, a collection of Document Objects that I could .First().Parent().DocumentName()?

Basically I want to display the parent Document Name of my repeated content as a header. There has to be an obvious way to do this but I can't figure it out.

Recent Answers

Trevor Fayas answered on March 8, 2016 15:41 (last edited on December 10, 2019 02:30)

The macro "Documents" or "RootDocument" may be where you need to go.

Here's some examples:

{% Documents["./SomeChild/%"].First().DocumentName() |(identity)GlobalAdministrator%}

if this helped, please mark as answered

0 votesVote for this answer Mark as a Correct answer

Jay Heavner answered on March 9, 2016 15:20 (last edited on December 10, 2019 02:30)

{% Documents["./SomeChild/%"]|(identity)GlobalAdministrator%} that turned ./SomeChild/% into /root/FirstLevel/SecondLevel/CurrentDocument/SomeChild

0 votesVote for this answer Mark as a Correct answer

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