How to access attachments in the Document attachments field using a transformation

Kentico Support asked on March 1, 2013 18:08

How to access attachments in the Document attachments field using a transformation

Correct Answer

Kentico Support answered on March 1, 2013 18:08

In order to display attachments in a transformation from the Document attachments field of a document, you can take advantage of the Text/XML transformation type and the following macro:

{% foreach (attachment in Documents[NodeALiasPath].AllAttachments) {
"<a href='~/getattachment/" + attachment.AttachmentGUID + "/attachment.aspx'>" + attachment.AttachmentName + "</a><hr />";
} %}

-jh-
1 votesVote for this answer Unmark Correct answer

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