2012-09-07 138 views
0

我已经将textstring属性“externalURL”添加到了我的Doctype中。我希望在文本字符串中输入外部网址,并在该导航中点击该链接时将该链接重定向到外部网址。Umbraco外部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

大小写敏感。我需要将“externalUrl”更改为“externalURL”以匹配我的属性类型。有时候这是最明显的事情。

+0

JV10,请你分享完整的XSLT文件吗?我也在为添加一个外部URL重定向到我的Umbraco网站。 – ajexpress