Link to home
Start Free TrialLog in
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
ASKER CERTIFIED SOLUTION
Avatar of lisfolks
lisfolks

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of LelloLello
LelloLello

ASKER