Umbraco外部URL重定向

时间:2012-09-07 07:24:28

标签: url xslt external umbraco

我在我的Doctype中添加了一个textstring属性“externalURL”。我想在文本字符串中输入外部URL,并在导航中单击该链接时将该链接重定向到外部URL。

但以下情况不起作用:

<a>
         <xsl:attribute name="href">
           <xsl:choose>
             <xsl:when test="string(externalUrl) != ''">
               <xsl:value-of select="externalUrl" />
             </xsl:when>
             <xsl:otherwise>
               <xsl:value-of select="umbraco.library:NiceUrl(@id)" />
             </xsl:otherwise>
           </xsl:choose>
         </xsl:attribute>
         <xsl:if test="descendant-or-self::*[@id = $currentPage/@id]">
           <xsl:attribute name="class">current</xsl:attribute>
         </xsl:if>
         <xsl:value-of select="@nodeName" />
       </a>

有人可以帮忙吗?

1 个答案:

答案 0 :(得分:1)

一个简单的区分大小写的问题。我需要将“externalUrl”更改为“externalURL”以匹配我的属性类型。有时这是最明显的事情。