Copied to clipboard

Flag this post as spam?

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


  • Jarrod Vanstan 4 posts 74 karma points
    Sep 12, 2016 @ 05:59
    Jarrod Vanstan
    0

    XSLT Data Type dropdown value id not text

    I'm trying to get the value of a Data Type drop down that I have used in the property of my page.

    I can easily get the text, but I need the value/id as I am using that to pass through to a query string on a search I have.

    I've tried several different things and none of the following worked:

    <xsl:value-of select="$currentPage/colorGroup//value/@id"/>
    

    And this didn't work:

    <xsl:if test="$currentPage/colorGroup !=''">
                                    <xsl:value-of select="string(umbraco.library:GetPreValueAsString($currentPage/colorGroup))"/>
                                </xsl:if>
    

    This didn't work either:

    <xsl:if test="string-length($currentPage/colorGroup) > 0">  
                                    <xsl:variable name="items" select="umbraco.library:Split($currentPage/colorGroup,',')" />  
                                    <xsl:for-each select="$items/value">
                                        <xsl:value-of select="umbraco.library:GetPreValueAsString(number(current()))"/>
                                    </xsl:for-each>
                                </xsl:if>
    

    Can anybody suggest a solution. I'm using Umbraco V4.11

Please Sign in or register to post replies

Write your reply to:

Draft