How to get a path of the original document location

Kentico Support Engineer asked on November 4, 2013 13:23

How to get a path of the original document location

Correct Answer

Kentico Support Engineer answered on November 4, 2013 13:23

Do you have linked documents in your content tree and you want to list them using a transformation?  If you would rather get their original path instead of the linked path, please use the following code to get the original location:

<%# CMS.CMSHelper.CMSContext.GetDocumentUrl(CMS.DocumentEngine.DocumentHelper.GetDocument(CMS.GlobalHelper.ValidationHelper.GetInteger(Eval("NodeLinkedNodeID"), 0), CMSContext.PreferredCultureCode, new CMS.DocumentEngine.TreeProvider()).DocumentID) %>

2 votesVote for this answer Unmark Correct answer

Recent Answers


Bui Tuong answered on December 2, 2014 08:19

In Kentico 8 : <%#CMSAbstractTransformation.GetDocumentUrl(CMS.DocumentEngine.DocumentHelper.GetDocument(ValidationHelper.GetInteger(Eval("NodeLinkedNodeID"), 0),CultureHelper.GetDefaultCultureCode(CMS.SiteProvider.SiteContext.CurrentSiteName),new CMS.DocumentEngine.TreeProvider()).DocumentID) %>

1 votesVote for this answer Mark as a Correct answer

Joel Dahlin answered on December 9, 2016 18:46

<%# GetDocumentUrl(Eval("DocumentID")) %>

2 votesVote for this answer Mark as a Correct answer

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