Current URL inside transformation

Novice User asked on July 20, 2018 22:11

Inside my transformation, I want to build a link based on what the current URL is. Basically windows.location search. How can I grab that into transformation and make an a link out of it. RequestContext.CurrentURL is returning nothing . I need to have the URL along with all its parameters.

Correct Answer

Peter Mogilnitski answered on July 21, 2018 03:47

Not sure if I understand you correctly: window.location.search will give you back query string.

  • in ACSX: <%=Request.QueryString%>
  • in TEXT/XML: {%QueryString%}

RequestContext is working, you just need it to call it fully qualified with namespace and parent class:

  • in ACSX: <%=CMS.Helpers.URLHelper.GetAbsoluteUrl(CMS.Helpers.RequestContext.CurrentURL)%>
  • in TEXT/XML: {% CurrentDocument.AbsoluteURL #%} or {% CurrentDocument.RelativeURL #%}
2 votesVote for this answer Unmark Correct answer

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