troubleshooting Question

XSLT Filter

Avatar of LelloLello
LelloLello asked on
Web Languages and StandardsXMLContent Management
2 Comments1 Solution502 ViewsLast Modified:
Hello

Why don’t you advice on how to do a filter in Sitecore - XSLT coding?? It has to be something simple that I'm missing!!!

 


<!-- ============================================ -->
  <!-- ======== SECTION MENU ACTIVITY  ============ -->
  <!-- ============================================ -->
  <xsl:template name="sectionmenu_activity">
    <xsl:param name="root" select="''" />
    <xsl:param name="level" select="0" />
    <!--<xsl:if test="contains($EnabledTemplates, concat('!', @template, '!')) ">-->
    <xsl:for-each select="$root/item[contains($EnabledTemplates, concat('!', @template, '!'))]">
      <xsl:sort select="@sortorder" data-type="number" />
      <xsl:variable name="IsHaveChild" select="boolean(./item)" />
      <xsl:variable name="IsSelected" select="boolean(./descendant-or-self::item[@id=$sc_currentitem/@id])" />
      <xsl:variable name="IsShow" select="boolean(sc:fld($IsHideFieldName,.)!=1)" />
      <xsl:variable name="IsCurrent" select="boolean(@id=$sc_currentitem/@id)" />
      <sc:sec />
      <xsl:if test="$IsShow">
        <li>
          <!--<img src="/images/menu/arrow.gif" width="9" height="14" border="0" alt="" />-->
          <xsl:attribute name="class">
            <xsl:choose>
              <!--if first level-->
              <xsl:when test="$level=0">
                <xsl:choose>
                  <xsl:when test="$IsSelected">
                    <xsl:value-of select="$CSSClassOpenItem" />
                  </xsl:when>
                  <xsl:otherwise>
                    <xsl:value-of select="$CSSClassCloseItem" />
                  </xsl:otherwise>
                </xsl:choose>
              </xsl:when>
              <!--if other level-->
              <xsl:otherwise>
                <xsl:if test="$IsSelected">
                  <xsl:value-of select="$CSSClassSelectedItem" />
                </xsl:if>
              </xsl:otherwise>
            </xsl:choose>
          </xsl:attribute>
          <xsl:variable name="href">
            <xsl:choose>
              <!--if this is the internal link-->
              <xsl:when test="./@template=$LinkTemplateName">
                <xsl:value-of select="sc:path(sc:item(sc:fld('link',.),.))" />
              </xsl:when>
              <!--otherwise-->
              <xsl:otherwise>
                <xsl:value-of select="sc:path(.)" />
              </xsl:otherwise>
            </xsl:choose>
          </xsl:variable>
          <a href="{$href}">
            <xsl:if test="sc:field($IsNewWindowFieldName,.) = 1">
              <xsl:attribute name="onclick">
                window.open('<xsl:value-of select="$href" />', '',''); return false;
              </xsl:attribute>
            </xsl:if>
            <xsl:call-template name="showtitle">
              <xsl:with-param name="root" select="." />
              <!-- ici -->
            </xsl:call-template>
          </a>
          <xsl:if test="$level &lt; $DeepLevel and $IsSelected and $IsHaveChild">
            <li class="subnav">
              <ul>
                <li>
                  <xsl:call-template name="sectionmenu_activity">
                    <xsl:with-param name="root" select="." />
                    <xsl:with-param name="level" select="$level+1" />
                  </xsl:call-template>
                </li>
              </ul>
            </li>
          </xsl:if>
        </li>
      </xsl:if>
    </xsl:for-each>
  </xsl:template>
  <!-- End of second box Menu -->
three-Menu.jpg
ASKER CERTIFIED SOLUTION
lisfolks

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 2 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros