Copied to clipboard

Flag this post as spam?

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


  • v4nilla 7 posts 26 karma points
    Jun 05, 2011 @ 01:09
    v4nilla
    0

    I have created a site with an XSLT menu. The menu works great as long as I specify a page name in the address bar. For example, if i type www.mydomain.com/default.aspx the menu shows up as expected and works perfectly. But, if I type www.mydomain.com no menu appears. It doesn't matter if the pages are protected or not, they don't show up either way unless there is a page name in the url. Any ideas or help would be appreciated. This is umbraco 4.0 and has to be because of a paypal macro that requires this version.

  • Fuji Kusaka 2203 posts 4220 karma points
    Jun 05, 2011 @ 06:50
    Fuji Kusaka
    0

    Hello,

    You are not seeing your default page (Homepage) in your menu or the whole menu?

     

    //fuji

  • v4nilla 7 posts 26 karma points
    Jun 06, 2011 @ 04:46
    v4nilla
    0

    The whole menu is missing unless I use a url like www.mydomain.com/default.aspx. If I put only www.mydomain.com as the url, then no menu appears. I loaded the page and appended the ?umbdebugshowtrace=true to the url using both methods and what I see in the results is the session Id is blank when the page is not specified as part of the url. Not sure why that would be. 

  • Jesper Hauge 298 posts 487 karma points c-trib
    Jun 06, 2011 @ 11:22
    Jesper Hauge
    0

    Hi v4nilla,

    Please try to post the xslt of you menu, that might help us help you :)

    Regards
    Jesper Hauge

  • v4nilla 7 posts 26 karma points
    Jun 08, 2011 @ 04:40
    v4nilla
    0

    Here is the code from the xslt

    <?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"
    exclude-result-prefixes="msxml umbraco.library">
    
    
    <xsl:output method="xml" omit-xml-declaration="yes" />
    
    <xsl:param name="currentPage"/>
    <xsl:param name="maxDeep" select="99"/>
    
    <!-- Don't change this, but add a 'contentPicker' element to -->
    <!-- your macro with an alias named 'source' -->
    <xsl:variable name="source" select="/macro/source"/>
    <xsl:variable name="menuName" select="/macro/menuName" />
    
    <xsl:template match="/">
    
    <xsl:call-template name="drawNodes">
    <xsl:with-param name="parent" select="umbraco.library:GetXmlNodeById($source)"/>
    </xsl:call-template>
    
    </xsl:template>
    
    <xsl:template name="drawNodes">
    <xsl:param name="parent"/>
    <xsl:param name="startLevel" select="$parent/@level" />
    <ul>
    <xsl:attribute name="class">sf-menu</xsl:attribute> 
    
    <xsl:for-each select="$parent/node [string(data [@alias='umbracoNaviHide']) != '1' and (umbraco.library:IsProtected(@id, @path) = false() or umbraco.library:HasAccess(@id, @path) = true())]">
    <li>
    <xsl:if test="@id=$currentPage/@id"> 
    <xsl:attribute name="class">selected</xsl:attribute> 
    </xsl:if>
    
    <xsl:if test="$currentPage/ancestor::node/@id = current()/@id"> 
    <xsl:attribute name="class">child_selected</xsl:attribute> 
    </xsl:if> 
    
    <a href="{umbraco.library:NiceUrl(@id)}">
    <xsl:value-of select="@nodeName"/>
    </a>
    
    <!-- recursive calling of same template for childs -->
    <xsl:if test="count(./descendant::node) > 0 and (./@level - $startLevel) &lt; $maxDeep">
    <xsl:call-template name="drawSubNodes">
    <xsl:with-param name="parent" select="."/>
    <xsl:with-param name="startLevel" select="$startLevel"/>
    </xsl:call-template>
    </xsl:if>
    </li>
    </xsl:for-each>
    </ul>
    </xsl:template>
    
    <!-- Build sub navigation dropdowns  -->
    <xsl:template name="drawSubNodes">
    <xsl:param name="parent"/>
    <xsl:param name="startLevel" select="$parent/@level" />
    <ul>
    <xsl:attribute name="class"><xsl:value-of select="concat('subnav',$parent/@level - $startLevel)" /></xsl:attribute> 
    
    <xsl:for-each select="$parent/node [string(data [@alias='umbracoNaviHide']) != '1' and (umbraco.library:IsProtected(@id, @path) = false() or umbraco.library:HasAccess(@id, @path) = true())]">
    <li>
    <xsl:if test="@id=$currentPage/@id"> 
    <xsl:attribute name="class">selected</xsl:attribute> 
    </xsl:if>
    
    <xsl:if test="$currentPage/ancestor::node/@id = current()/@id"> 
    <xsl:attribute name="class">child_selected</xsl:attribute> 
    </xsl:if> 
    
    <a href="{umbraco.library:NiceUrl(@id)}">
    <xsl:value-of select="@nodeName"/>
    </a>
    
    <!-- recursive call of sub node builder if more than one level deep -->
    <xsl:if test="count(./descendant::node) > 0 and (./@level - $startLevel) &lt; $maxDeep">
    <xsl:call-template name="drawSubNodes">
    <xsl:with-param name="parent" select="."/>
    <xsl:with-param name="startLevel" select="$startLevel"/>
    </xsl:call-template>
    </xsl:if>
    </li>
    </xsl:for-each>
    </ul>
    </xsl:template>
    
    </xsl:stylesheet> 
  • v4nilla 7 posts 26 karma points
    Jun 14, 2011 @ 04:44
    v4nilla
    0

    I fixed it! The XSLT works great as I expected. The issue was with the web.config. The following changes were made and all is well now.

    In the web.config, the <modules> section was missing some text as shown below.

    <modules runAllManagedModulesForAllRequests="True">

    After the closing </modules> tag, the following also needed to be added:

    <defaultDocument>

                <files>

                    <clear />

                    <add value="index.php" />

                    <add value="Default.htm" />

                    <add value="Default.asp" />

                    <add value="index.htm" />

                    <add value="index.html" />

                    <add value="iisstart.htm" />

                    <add value="default.aspx" />

                </files>

            </defaultDocument>

     

    Without both additions, the menu would not work. 

Please Sign in or register to post replies

Write your reply to:

Draft