Macro expression in documents displaying by repeater

Mateusz Żebrowski asked on July 7, 2015 13:35

I've got following problem. In some documents I created headers using repeater. Transformation displaying document name for each item taken by this repeater, so if I set path to current document I get name of this document. It is as simple as write dot in path text box. Problem appears when I try to display those documents in another repeater (inside transformation I have page placeholder control). In this case I didn't get name of each document but I get name of document on which i put second repeater.

So I thought I can use macro expression to retrieve documents names using CurrentDocumnet.DocumentNode.NodeAliasPath but it works in the same way as previous solution. Is there any macro expression which can solve this problem?

Recent Answers


Virgil Carroll answered on July 7, 2015 15:35

Mateusz,

If I am understanding you correctly, you are trying to use a CurrentDocument macro to get the Document URL inside a repeater? If so, the CurrentDocument macro will always get the document you are on. Instead try using the <%# GetDocumentUrl() %> in your ASPX transofrmation, which will pull the URL of the document being pulled by the repeater.

Tx, Virgil

0 votesVote for this answer Mark as a Correct answer

Roman Hutnyk answered on July 7, 2015 18:15

Mateusz,

Why don't you simply use <%# Eval("DocumentName") %> in the listing transformation? It should actually work for both cases you've described.

0 votesVote for this answer Mark as a Correct answer

Virgil Carroll answered on July 8, 2015 00:13

Ha Roman you are correct, I was just looking at the 2nd effort to get the document path and re-reading it looks like he is just trying to get the name

0 votesVote for this answer Mark as a Correct answer

Mateusz Żebrowski answered on July 8, 2015 07:23

I'm not writing transformation. I try to set value of path in repeater. I mean when you switch to design tab in cms desk and configure repeater you can take documents from datasource or by entering path. I try to get path of current document and i don't want to set it directly because template on which I have repeater are clone as ad-hoc when new document is created. It will be faster if I don't have to configure path each time.

0 votesVote for this answer Mark as a Correct answer

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