Copied to clipboard

Flag this post as spam?

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


  • warsnickv 4 posts 24 karma points
    Nov 07, 2012 @ 15:18
    warsnickv
    0

    Help Menu doesn't work anymore

    hi all,

    I have upgrade mij umbraco 4.5.2(.NET 3.5) website to umbraco 4.9.1(.NET4.0).
    On my old umbraco worked my menu wat i had made with xslt.
    So my question is: Can someone help me to solve this problem?

    xslt code is down here.

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE xsl:stylesheet [
      <!ENTITY nbsp "&#x00A0;">
    ]>
    <xsl:stylesheet 
        version="1.0" 
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
        xmlns:msxml="urn:schemas-microsoft-com:xslt" 
        xmlns:umbraco.library="urn:umbraco.library" xmlns:Exslt.ExsltCommon="urn:Exslt.ExsltCommon" xmlns:Exslt.ExsltDatesAndTimes="urn:Exslt.ExsltDatesAndTimes" xmlns:Exslt.ExsltMath="urn:Exslt.ExsltMath" xmlns:Exslt.ExsltRegularExpressions="urn:Exslt.ExsltRegularExpressions" xmlns:Exslt.ExsltStrings="urn:Exslt.ExsltStrings" xmlns:Exslt.ExsltSets="urn:Exslt.ExsltSets" 
        exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets ">
    
    
      <xsl:output method="xml" omit-xml-declaration="yes"/>
    
      <xsl:param name="currentPage"/>
    
      <!-- Input the level you want here -->
      <xsl:variable name="startLevel" select="1"/>
      <xsl:variable name="maxLevel" select="3"/>
      <xsl:variable name="displayLevel" select="3"/>
    
      <xsl:template match="/">
    
        <xsl:call-template name="drawMenu">
          <xsl:with-param name="rootNode" select="$currentPage/ancestor-or-self::* [@isDoc][@level=1]"/>
        </xsl:call-template>
    
      </xsl:template>
    
      <xsl:template name="drawMenu">
        <xsl:param name="rootNode"/>
    
        <ul class="{concat('level',$rootNode/@level)}">
          <xsl:call-template name="drawNodes">
            <xsl:with-param name="parentNode" select="$rootNode"/>
          </xsl:call-template>
        </ul>
    
      </xsl:template>
    
      <xsl:template name="drawNodes">
        <xsl:param name="parentNode"/>
    
        <xsl:for-each select="$parentNode/* [@isDoc]
                [string(umbracoNaviHide) != '1']
                [@level &lt;= $maxLevel]
                [not(umbraco.library:IsProtected(@id, @path)) 
                or umbraco.library:IsLoggedOn() 
                and umbraco.library:HasAccess(@id, @path) = true()]">
          <xsl:sort select="@sortOrder" order="ascending" data-type="number" />
    
          <xsl:variable name="isSelected" select="$currentPage/ancestor-or-self::*/@id = current()/@id"/>
          <xsl:variable name="isChildSelected" select="$currentPage/ancestor-or-self::*/@id != current()/@id and $currentPage/@id != current()/@id"/>
          <xsl:variable name="hasChilds" select="count(* [@isDoc][string(umbracoNaviHide) != '1' and @level &lt;= $maxLevel]) &gt; 0"/>
    
          <li>
            <!-- alt="{umbraco.library:IsProtected($parentNode/@id, $parentNode/@path)}-{umbraco.library:IsLoggedOn()}" -->
            <a href="{umbraco.library:NiceUrl(@id)}" alt="[{@level -1}] {$currentPage/ancestor-or-self::*/@id} - {current()/@id} (hasChilds={$hasChilds}, isSelected={$isSelected}, isChildSelected={$isChildSelected}">
              <xsl:choose>
                <xsl:when test="$isSelected and $isChildSelected">
                  <xsl:attribute name="class">selectedparent</xsl:attribute>
                </xsl:when>
                <xsl:when test="$isSelected">
                  <xsl:attribute name="class">selected</xsl:attribute>
                </xsl:when>
                <xsl:otherwise>
                  <xsl:attribute name="class">default</xsl:attribute>
                </xsl:otherwise>
              </xsl:choose>
    
              <xsl:value-of select="@nodeName"/>
            </a>
    
            <xsl:if test="(@level &lt;= $displayLevel or $isSelected) and $hasChilds">
              <ul class="{concat('level',@level)}">
                <xsl:call-template name="drawNodes">
                  <xsl:with-param name="parentNode" select="."/>
                </xsl:call-template>
              </ul>
            </xsl:if>
          </li>
        </xsl:for-each>
    
      </xsl:template>
    </xsl:stylesheet>
    
    Thank you
  • Tom Fulton 2030 posts 4998 karma points c-trib
    Nov 07, 2012 @ 16:17
    Tom Fulton
    0

    Hi,

    What results are you getting with the above?  Is it loading but displaying incorrectly or are you getting an error message when you save it?  Can you post the error?

    Also, if you're seeing a generic error on the front-end of your site (ie Error parsing XSLT file), try adding ?umbdebugshowtrace=1 to your URL and look down at the trace to get the real error.

    -Tom

  • warsnickv 4 posts 24 karma points
    Nov 07, 2012 @ 17:12
    warsnickv
    0

    Hi,

    I'm  not getting any error that was the problem.

    But i have already fixt that he shows my first level menu. 
    the problem was [@isDoc] in my for each.

    do you know how to fix that he shows my second level menu by hover?

    Thank you.

  • warsnickv 4 posts 24 karma points
    Nov 07, 2012 @ 17:40
    warsnickv
    0

    Hi, 

    It was the same problem again [@isDoc] in my select.

    Thank you for your help.

    Best regards

Please Sign in or register to post replies

Write your reply to:

Draft