Copied to clipboard

Flag this post as spam?

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


  • Connie DeCinko 931 posts 1160 karma points
    Apr 21, 2011 @ 19:07
    Connie DeCinko
    0

    Pass URL variable to iframe

    I am passing an URL variable from one Umbraco page to another.  I need to then pass that optional URL variable to an iframe in the target Umbraco page.  The iframe is inside a macro that contains an XSLT snippet.  How can I pass the URL variable to the macro?

     

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Apr 21, 2011 @ 19:38
    Jan Skovgaard
    0

    Hi Connie

    Would it be possible to add a macro parameter where the url could be stored and then fetched in the XSLT snippet?

    /Jan

  • Connie DeCinko 931 posts 1160 karma points
    Apr 21, 2011 @ 19:41
    Connie DeCinko
    0

    We're thinking the same, I'm just not sure how to fetch the variable in the XSLT.  It would have to get the variable of the parent/container page.

     

  • Connie DeCinko 931 posts 1160 karma points
    Apr 21, 2011 @ 19:46
    Connie DeCinko
    0

    Could this work?

    <Iframe src="displayframe.asp?<%= request.querystring%>"></iframe>

     

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Apr 21, 2011 @ 19:50
    Jan Skovgaard
    1

    Inside XSLT? No...then it would need to look like this...

    <iframe src="displayframe.asp?parameter={umbraco.library:Request('querystring')}"></iframe>

    But if you store the value in a macro parameter you should be able to fetch it by declaring a parameter like this

    <xsl:param name="iframeParameter" select="/macro/YourParameterAlias" /> where "YourParameterAlias" is the alias you have speficied on the macro parameter.

    /Jan

  • Connie DeCinko 931 posts 1160 karma points
    Apr 21, 2011 @ 20:46
    Connie DeCinko
    0

    Oh, I'm thinking about this wrong.  The macro and XSLT are actually running as part of the Umbraco page, so would have access to the querystring.

     

    <xsl:param name="qryString" select="umbraco.library:RequestServerVariables('QUERY_STRING')" />
    <iframe src="{$iframeSource}?{$qryString}" name="{$iframeName}_iframe"></iframe>
Please Sign in or register to post replies

Write your reply to:

Draft