Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > Document linking View modes: 
User avatar
Member
Member
Krotki - 3/22/2010 3:03:34 AM
   
Document linking
Hi,
When I link document to another leaf in site tree - de facto copy of that document is created in database. So when I want to GetDocumentURL in transformation it returns URL of a copy. How can I return URL of an original document in transformation ?

User avatar
Kentico Developer
Kentico Developer
kentico_martind - 4/4/2010 4:40:35 AM
   
RE:Document linking
Hello,

You can ensure this by custom code in custom function for transformations . Basically you will need to get TreeNode object of original node using SelectSingleNode method - you can use value of NodeLinkedNodeID property of current node as parameter. Then you can use alias path of original node to get its URL using following sample code:

CMS.GlobalHelper.UrlHelper.GetAbsoluteUrl(CMS.CMSHelper.CMSContext.GetUrl(aliasPath));

Best Regards,

Martin Dobsicek

User avatar
Member
Member
Krotki - 4/6/2010 3:15:07 AM
   
RE:Document linking
Thanks for the solution. It really works !