Portal Engine Questions on portal engine and web parts.
Version 6.x > Portal Engine > GetDocumentUrl in Text/XML Transformation in Repeater View modes: 
User avatar
Certified Developer 8
Certified Developer 8
Jiveabillion - 12/20/2011 1:13:38 PM
   
GetDocumentUrl in Text/XML Transformation in Repeater
I am trying to use a text/xml transformation in a repeater to list documents.
In my transformation, I want to get the url for the document that is currently being rendered by the repeater. However, when I use {% GetDocumentUrl() %} it returns the permanent url of the document that I am currently viewing (the document/page that the repeater is on). Interestingly enough, when I use {% GetDocumentLink() %} it renders a link with the proper URL. I don't want to use GetDocumentLink() because I want to customize the way the link is rendered.

Basically, It appears that {%GetDocumentUrl()%} inside a text/xml transformation uses the wrong document in context.

Am I doing this wrong or is this a bug?

User avatar
Member
Member
kentico_michal - 12/26/2011 11:37:58 PM
   
RE:GetDocumentUrl in Text/XML Transformation in Repeater
Hello,

Have you tried to use the following expression:

<%# GetDocumentUrl() %>

If it does not help, could you please post here the transformation that you are using so I could try to reproduce it.

Moreover, which web part are you using (Repeater, XML Repeater etc.)?

Thank you.

Best regards,
Michal Legen


User avatar
Certified Developer 8
Certified Developer 8
Jiveabillion - 12/26/2011 11:53:57 PM
   
RE:GetDocumentUrl in Text/XML Transformation in Repeater
I didn't think you could use asp code blocks in an xml/text transformation. Am I correct in this assumption? If so, then using <% GetDocumentUrl() %> will not work. I have already switched my transformation to ASCX type to get around the problem, but I need to know why it didn't work using the K# macro in the XML/text transformation.

User avatar
Member
Member
kentico_michal - 12/28/2011 2:12:18 AM
   
RE:GetDocumentUrl in Text/XML Transformation in Repeater
Hello,

The Text/HTML transformation type processes the code as basic HTML. This means that any ASCX markup, such as controls or inline code, will not be functional when the transformation is rendered. You may use Kentico CMS Macro expressions and methods to insert dynamic values into the content. Only expressions in the following format allow you to easily get the values of the given document's fields: {%ColumnName%}.

Best regards,
Michal Legen

User avatar
Certified Developer 8
Certified Developer 8
Jiveabillion - 12/28/2011 2:26:11 AM
   
RE:GetDocumentUrl in Text/XML Transformation in Repeater
I am already aware of everything you have said Michal. The problem remains that I cannot get the document url of the repeater's current data item using {%GetDocumentUrl()#} It instead returns the url of the document currently being visited by the url.

Have you tried to reproduce this issue? If I cannot use {% GetDocumentURL()%}, then what should I use?

I am frustrated that it has been several days since I first reported this issue and have yet to get an answer from someone who seems to fully understand the problem.

User avatar
Member
Member
kentico_michal - 1/2/2012 2:40:36 AM
   
RE:GetDocumentUrl in Text/XML Transformation in Repeater
Hello,

If you need to solve the issue faster, you can write us an email (support@kentico.com) next time, if you have valid maintenance. Anyway, I was able to reproduce this issue. Regrettably, the fact that the {%GetDocumentUrl() %} method is not resolved in the Text/XML transformation seems to be a bug in the current version of Kentico CMS. We will try to fix it in the next hotfix for the current version of Kentico CMS. Thank you for letting us know about this issue.

Best regards,
Michal Legen

User avatar
Certified Developer 8
Certified Developer 8
Jiveabillion - 1/3/2012 12:15:07 PM
   
RE:GetDocumentUrl in Text/XML Transformation in Repeater
Thank you Michal. I will use the support@kentico.com email in the future.