2014-09-24 24 views
0

使用Umbraco/XSLT登錄時隱藏某個菜單項會產生一個小問題。使用Umbraco/XSLT登錄時隱藏菜單項

我這片XSLT的輸出菜單項

<li> 
    <a href="{$url}" class="{$class}">  
     <xsl:if test="$currentPage/ancestor-or-self::*/@id = ./@id"> 
      <xsl:attribute name="class">active</xsl:attribute> 
      <xsl:if test="$node/@level = 3"> 
       <i class="{$iconClass}"></i> 
      </xsl:if> 
     </xsl:if> 
     <xsl:value-of select="$node/@nodeName" />   
    </a> 
    <xsl:if test="$active"> 
     <xsl:call-template name="list"> 
      <xsl:with-param name="parent" select="$node" /> 
     </xsl:call-template>  
    </xsl:if> 
</li> 

我想是能夠exlude有在屬性「hideAtLogin」真正的菜單項,在登錄時。

我試圖與

<xsl:if test="umbraco.library:IsLoggedOn = 'false' and hideAtLogin = ''"> 
... 
</xsl:if> 

但是,這並不工作...

當沒有選擇hideAtLogin(= FALSE),該項目應無論登錄還是不中。

回答

0

得到它與

<xsl:if test="not(umbraco.library:IsLoggedOn()) or (umbraco.library:IsLoggedOn() and hideAtLogin != 1)"> 
... 
</xsl:if> 
工作
0

僅有2建議:
有你已經嘗試過改變

<xsl:if test="umbraco.library:IsLoggedOn = 'false' ..">..</xsl:if> 

<xsl:if test="umbraco.library:IsLoggedOn() = false() ..">..</xsl:if> 

在此情況下,仍不能正常工作,它可能是服務器問題,因爲這裏所說的對於有類似問題的人?

Umbraco.Library.IsLoggedOn() does not work from XSLT

問題出現了,這次會議是不可用XSLT由於服務器配置和web.config中不得不進行調整。