简体   繁体   English

Umbraco菜单宏创建重复项

[英]Umbraco menu macro creating duplicates

I'm having problems with a menu macro in Umbraco.. 我在Umbraco中使用菜单宏时遇到问题。

My macro returns a ul with li elements, one for each page. 我的宏返回一个带li元素的ul,每页一个。

<xsl:output method="xml" omit-xml-declaration="yes" />
<xsl:param name="currentPage"/>
<xsl:variable name="level" select="1"/>
<xsl:template match="/">

<ul>
<xsl:for-each select="$currentPage/ancestor-or-self::* [@isDoc and @level=$level]/* [@isDoc and string(umbracoNaviHide) != '1']">
  <li>
    <a href="{umbraco.library:NiceUrl(@id)}">
      <xsl:if test="$currentPage/ancestor-or-self::*/@id = current()/@id">
        <xsl:attribute name="class">selected</xsl:attribute>
      </xsl:if>
      <xsl:value-of select="@nodeName"/>
    </a>
  </li>
</xsl:for-each>
</ul>
</xsl:template>

The problem that I've encountered is that two pages are duplicated even though I only have one of each and the links on them work and point ot the same page. 我遇到的问题是即使我只有一个页面并且两个页面上的链接都可以工作并且指向同一页面,但是两个页面是重复的。

I also have another problem and that is that the last li element is missplaced, but only on Firefox...Chrome and Safari work fine... 我还有另一个问题,那就是最后一个li元素放错了位置,但是仅在Firefox上... Chrome和Safari可以正常工作...

Any ideas? 有任何想法吗?

The solution was annoyingly simple, just "republish entire site" and all problems were history. 解决方案非常简单,只需“重新发布整个网站”,所有问题都是历史。 My guess is that some stuff got stuck in the cache... 我的猜测是某些东西卡在了缓存中...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM