Avatar of LelloLello
LelloLello
 asked on

XSLT Filter

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 -->

Open in new window

three-Menu.jpg
Web Languages and StandardsXMLContent Management

Avatar of undefined
Last Comment
LelloLello

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
lisfolks

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
LelloLello

ASKER
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy