Copied to clipboard

Flag this post as spam?

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


  • Sarah H 5 posts 25 karma points
    Aug 02, 2011 @ 23:53
    Sarah H
    0

    UrlPicker - Passing as a parameter in a macro

    Hi

    I recently changed a contentpicker to a urlpicker as I require the user to choose either an internal or external link (amongst other things). So I can have a reusable xslt script, I was passing the info to my xslt macro via a parameter. When it was a contentpicker, the macro worked correctly, however, since I changed it to urlpicker, the parameter is never being set even though I have populated the urlpicker and published the page. (I checked using <xsl:copy-of select="/macro" />).

    Can anyone offer any advice? I've tried experimenting but nothing has worked. I'm using umbraco 4.7.

    Thanks!

  • Lee Kelleher 4026 posts 15836 karma points MVP 13x admin c-trib
    Aug 03, 2011 @ 09:59
    Lee Kelleher
    0

    Hi Sarah,

    I can reproduce this, but not sure of a solution (yet).  Problem seems to be with when the data format is set to XML, as it works fine as CSV (althought not ideal for XSLT right?!)

    As as workaround, you could access the Url Picker data (XML) directly in the XSLT? (quick code snippet)

    <a href="{$currentPage/urlPicker/url-picker/url}">
        <xsl:if test="normalize-space($currentPage/urlPicker/url-picker/node-id)">
            <xsl:attribute name="href">
                <xsl:value-of select="umbraco.library:NiceUrl($currentPage/urlPicker/url-picker/node-id)" />
            </xsl:attribute>
        </xsl:if>
        <xsl:if test="$currentPage/urlPicker/url-picker/new-window = 'True'">
            <xsl:attribute name="target">_blank</xsl:attribute>
        </xsl:if>
        <xsl:value-of select="$currentPage/urlPicker/url-picker/link-title"/>
    </a>

    Unless there's a reason to use it with a Macro parameter?

    Cheers, Lee.

  • Sarah H 5 posts 25 karma points
    Aug 04, 2011 @ 22:45
    Sarah H
    0

    Hi Lee

    Sorry for the delay in my reply, thank you for investigating this issue! I was wanting to use this datatype as one part of a widget thing where there could (and probably will) be more than one on an individual page, which is why I wanted to pass it in as a paramater.

    I think I will just have to rethink how I implement this since it doesn't look like I can do it in the way I originally wanted. 

    Thanks for your help!

    Sarah

Please Sign in or register to post replies

Write your reply to:

Draft