Copied to clipboard

Flag this post as spam?

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


  • trfletch 598 posts 604 karma points
    Mar 11, 2010 @ 11:53
    trfletch
    0

    Display results based on a drop down list selection

    Hi, I have an Umbraco V4 website and I have created a couple of Ultimate picker datatypes based on childs of the the following nodes (Locations and Categories):

    Locations
          - Location A
          - Location B
          - Location C

    Categories
          - Category A
          - Category B
          - Category C

    The Locations Ultimate picker datatype is a dropdown list and the Catergories Ultimate picker datatype is a checkbox list where multiple selections can be selected. These two datatypes are included on a Document type called "Job". I have created a search based on Location and Categories that passes a query string to my search results page. I am having trouble displaying results when a Category is selected because I am not sure how I check whether the Category is selected in XSLT. So far I have the following XSLT, can anyone see what I am doing wrong?

    <!-- GET CATEGORY QUERY STRING -->
    <xsl:variable name="categoryquery">
    <xsl:choose>
            <xsl:when test="umbraco.library:Request('category') &lt;= 0 or string(umbraco.library:Request('category')) = '' or string(umbraco.library:Request('category')) = 'NaN'">0</xsl:when>
            <xsl:otherwise>
                    <xsl:value-of select="umbraco.library:Request('category')"/>
            </xsl:otherwise>
    </xsl:choose>
    </xsl:variable>
    <!-- GET LOCATION QUERY STRING -->
    <xsl:variable name="locationquery">
    <xsl:choose>
            <xsl:when test="umbraco.library:Request('location') &lt;= 0 or string(umbraco.library:Request('location')) = '' or string(umbraco.library:Request('location')) = 'NaN'">0</xsl:when>
            <xsl:otherwise>
                    <xsl:value-of select="umbraco.library:Request('location')"/>
            </xsl:otherwise>
    </xsl:choose>
    </xsl:variable>
    <xsl:for-each select="umbraco.library:GetXmlNodeById(1148)/node [string(data [@alias='umbracoNaviHide']) != '1' and contains(data [@alias='category'], $categoryquery) and string(data [@alias='location']) = $locationquery]"> 
      
      <xsl:call-template name="displayResults">
      </xsl:call-template>
      
    </xsl:for-each>
  • trfletch 598 posts 604 karma points
    Mar 11, 2010 @ 12:11
    trfletch
    0

    Please ignore this, my code seems to work fine but it was not working because of a spelling mistake in my Job document type!!!

Please Sign in or register to post replies

Write your reply to:

Draft