Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • arviman 71 posts 92 karma points
    Sep 01, 2010 @ 02:48
    arviman
    0

    Getting the current URL of the request into xslt

    Hi, is there a way in which i could obtain the request's URL inside an xslt macro. I don't want to use umbraco.library:niceUrl ($currentPage/@id) as it won't work in the case where i redirect to a page using an internalRedirect.

    I can obtain this value on my template using <% Response.Write(Request.Url);%> however trying to pass in a value like the following does not seem to work. Snippet

    <umbraco:Macro currentURL="<% (Request.Url);%>" runat="server" ID="Macro1" Alias="foo"></umbraco:Macro>

    Could someone tell me if I'm going about this the right way. Is there a more direct way of obtaining this value using umbraco variables itself? Thanks in advance!

     

  • Steen Tøttrup 191 posts 291 karma points c-trib
    Sep 01, 2010 @ 07:03
    Steen Tøttrup
    1

    Try this from xslt:

           <xsl:value-of select="umbraco.library:RequestServerVariables('URL')"/>

    That might work, not sure how it handles an internal redirect tho.

     

Please Sign in or register to post replies

Write your reply to:

Draft