Copied to clipboard

Flag this post as spam?

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


  • Gary 40 posts 129 karma points
    Sep 24, 2013 @ 13:12
    Gary
    0

    Filter results with drop down menu

    Hello,

    I am fairly new to Umbraco and would appreciate a little guidance if anyone could help.

    I basically want to be able to filter node results with a drop down list.

    I have this code producing a list of the nodes that i want depending on what page you are on.

    <xsl:for-each select="$caseNode/*[@isDoc and @template = $templateID and contains(ssnPortalCaseTheme,$caseTheme)]">
                <xsl:sort select="@nodeName" data-type="text" order="ascending"/>   
                <a href="{umbraco.library:NiceUrl(@id)}" style="float:left; margin: 0 20px 10px 0;">
                    <xsl:value-of select="@nodeName"/>
                </a><br /><br />
            </xsl:for-each>
    

    I also have a drop down list with some options i want to filter the nodes by using this code.

    <xsl:variable name="localAuthority" select="umbraco.library:GetPreValues('4920')"/>
            <select onchange="this.form.submit()">
                <option value="0">Select Local Authority</option>
                <xsl:for-each select="$localAuthority//preValue">  
                    <option value="{@id}">
                        <xsl:value-of select="current()"/>
                    </option>   
                </xsl:for-each>
            </select>
    

    I'm not to sure where to go from here. Can anyone point me in the right direction?

    Thanks for looking

  • Kasper Dyrvig 246 posts 379 karma points
    Sep 27, 2013 @ 00:05
    Kasper Dyrvig
    0

    Hi Gary,

    Question: What do want to sort by? Date, name, or something else? What result are you looking for?

  • Gary 40 posts 129 karma points
    Oct 01, 2013 @ 10:50
    Gary
    0

    Hi Kasper, I want to be able to sort by 3 options. They are data types that i have set up. Location, type and theme. I have associated these properties to the nodes and want to be able to filter the results with the drop down lists.

Please Sign in or register to post replies

Write your reply to:

Draft