Copied to clipboard

Flag this post as spam?

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


  • syn-rg 282 posts 425 karma points
    Feb 23, 2012 @ 01:03
    syn-rg
    0

    Filter child nodes to checkbox value

    I want to display only the child nodes with the checkbox value "Technology" selected, value 252 in my checkbox list.

    I have two macros, one that displays thumbnails of the child nodes (ProjectsAlbum.xslt) and one that is a filter for refining the child nodes to specific values, via options selected in a select menu (ProjectsFilter.xslt) .

    I've created a datatype checkbox list (Project Type) with the following:
    Text                          Value
    Fitout                        149
    Refurbishment          150
    Heritage                    227
    Sustainability            228
    New Build                 230
    $5 Million+                249
    Government             251
    Technology              252

    How can I make the default value of the select menu "Techology" and therefor only display child nodes with that checkbox checked?

    Do I need to make the change to the Projects Album which is pulling in all the child nodes or do I make the change to the Projects Filter?

    Here's the ProjectsAlbum.xslt:

     <xsl:variable name="possibleNodes" select="$currentPage/ancestor-or-self::root//*
     [@isDoc and string(./umbracoNaviHide) != '1' and name() != 
    'ProjectGallery' and name() = 'ProjectPage']" />

    Here's the ProjectsFilter.xslt:

          <fieldset>
            <xsl:variable name="projectTypeList" select="umbraco.library:GetPreValues(1212)//preValue" />
            <select name="projectType" id="projectType"  onchange="document.getElementById('aspnetForm').submit()" >
              <option value="">All project types</option>
              <xsl:for-each select="$projectTypeList">
                <xsl:sort order="ascending" data-type="text" />
                 <option value="{.}">
                   <xsl:if test="$FF_projectTypeList = .">
                     <xsl:attribute name="selected">selected</xsl:attribute>
                   </xsl:if>
                  <xsl:value-of select="." />
                </option>       
              </xsl:for-each>
            </select>        
          </fieldset>
  • Gary 40 posts 129 karma points
    Sep 10, 2013 @ 13:24
    Gary
    0

    Hi. Did you find a solution for this?

    Thanks

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies