Copied to clipboard

Flag this post as spam?

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


  • Erik 7 posts 37 karma points
    Jan 22, 2012 @ 21:39
    Erik
    0

    Navigation only visible to the publisher, not other people

    Hi,

    I've a really weird problem. I've created a xslt macro for rendering a navigation menu. After creating some nodes in the content tree and requesting the page the menu is rendered correctly. Except the menu is only visible to me, not to other people who visit the site. If other people add nodes in the content tree, these should turn up in the navigation menu as well except this is not the case. Only the items I publish are rendered and visible to me.

    The settings for the xslt macro are CacheByPage = true with 0 seconds (so it's not being cached).

    T.i.a,

    Erik.

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Jan 22, 2012 @ 21:52
    Jan Skovgaard
    0

    Hi Erik and welcome to our

    What does your XSLT file look like?

    And how do you access the published nodes? Are you navigating them on the website or using the preview from the umbraco backoffice?

    /Jan

  • Erik 7 posts 37 karma points
    Jan 22, 2012 @ 22:10
    Erik
    0

    Hi Jan,

    The frontpage should render a menu with links to the content nodes (which it does for me but not for other visitors). So when I go the the frontpage (not preview, but just the real url) it shows me the menu but others can't see it. If other people add content nodes which should turn up in the menu after publishing this does not happen for me (I can't see the node). However, if I add a content node myself and publish it it shows up in the menu.

    My xslt looks like this:


    xsl:stylesheet [ ]>
    <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"/>

    <xsl:variable name="level" select="1"/>

    <xsl:template match="/">

      <xsl:call-template name="Navigatie">
        <xsl:with-param name="Page" select="$currentPage"/>
        <xsl:with-param name="Level" select="$level"/>
        <xsl:with-param name="Class">
          <xsl:text>nav-outerxsl:text>
        xsl:with-param>
        <xsl:with-param name="Prefix">
          <xsl:text>> xsl:text>
        xsl:with-param>
      xsl:call-template>

    xsl:template>
                          
    <xsl:template name="Navigatie">
      <xsl:param name="Page"/>
      <xsl:param name="Level"/>
      <xsl:param name="Class" />
      <xsl:param name="Prefix" />
      
      <ul class="{$Class}">
        <xsl:for-each select="$Page/ancestor-or-self::* [@isDoc and @level=$Level]/* [@isDoc and string(umbracoNaviHide) != '1']">
          <li class="{$Class}">
            <xsl:choose>
              <xsl:when test="$Page/ancestor-or-self::*/@id = current()/@id or current()/@id = someId">
                <span>
                  <xsl:value-of select="$Prefix"/><xsl:value-of select="@nodeName"/>
                span>
                <xsl:if test="current()/@id = someId">
                  <xsl:call-template name="Navigatie">
                    <xsl:with-param name="Page" select="current()"/>
                    <xsl:with-param name="Level" select="2"/>
                    <xsl:with-param name="Class">
                      <xsl:text>nav-innerxsl:text>
                    xsl:with-param>
                    <xsl:with-param name="Prefix">
                      <xsl:text> xsl:text>
                    xsl:with-param>
                  xsl:call-template>
                xsl:if>
              xsl:when>
              <xsl:otherwise>
                <a>
                  <xsl:attribute name="href">
                    <xsl:choose>
                      <xsl:when test="count(./*) > 0">
                        <xsl:value-of select="umbraco.library:NiceUrl(./child::node()[1]/@id)"/>
                      xsl:when>
                      <xsl:otherwise>
                        <xsl:value-of select="umbraco.library:NiceUrl(@id)"/>
                      xsl:otherwise>
                    xsl:choose>
                  xsl:attribute>
                  <xsl:attribute name="class">
                    <xsl:value-of select="$Class"/>
                  xsl:attribute>
                  <xsl:value-of select="$Prefix"/><xsl:value-of select="@nodeName"/>
                a>
              xsl:otherwise>
            xsl:choose>
          li>
        xsl:for-each>
      ul>
    xsl:template>

    xsl:stylesheet>


    T.i.a,

    Erik.

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Jan 22, 2012 @ 22:20
    Jan Skovgaard
    0

    Hi Erik

    Hmm, yes that is indeed odd.

    I think you should perhaps check permissions for network user and iusr accounts and see if they are sufficient. Eventually try to just give full permissions to the everyone role to see if it does a difference and then take it from there...

    Is there something special about the setup? Is it hosted in a cloud or does it use load balancing or something third?

    /Jan

  • Erik 7 posts 37 karma points
    Jan 22, 2012 @ 22:30
    Erik
    0

    Hi Jan,

    I don't know if there's anything special about the setup, it's just a commercial hosting package. It sounds to me like some sort of caching problem, but then I would have expected the navigation menu not to be rendered for everyone instead just me. I'm not sure if it uses loadbalancing through multiple servers which could explain it, I think it's just one server.

    PS For the record, the nodes in the backoffice are visible for everyone. The problem just occurs with the rendering of the navigation menu on the "real" website.

    T.i.a,

    Erik.

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Jan 22, 2012 @ 23:15
    Jan Skovgaard
    0

    Hi Erik

    Hmm, it's probably just a "normal" setup then.

    What happens if you go to the top "Content" node, right click and select "Republish entire site" - are the nodes then visible to the other visitors?

    Also I would still recommend that you have a look at the permissions set on the umbraco root folder.

    /Jan

  • Erik 7 posts 37 karma points
    Jan 23, 2012 @ 10:12
    Erik
    0

    Republishing did the trick. Still, it's weird that I could see the menu and other people didn't. Anyway, thanks for the help.

    Erik.

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Jan 28, 2012 @ 00:26
    Jan Skovgaard
    0

    Hi Erik

    Sorry for my late reply.

    It's good to hear you got it solved by repbulishing. Must admit I'm not sure why you could see the nodes but others could not see them. Have never encountered that on at sinle server setup before.

    If you encounter this again please don't hesitate to let us know.

    /Jan

Please Sign in or register to post replies

Write your reply to:

Draft