2009-05-22 13 views
0

私は左のメニューにマクロを作成しましたが、それは問題ありません。メニュー内のumbracoマクロ

別のマクロを作成せずに右のメニューに同じマクロを使用したいとします。

どうすればよいですか?

<?xml version="1.0" encoding="UTF-8"?> 
<!DOCTYPE xsl:Stylesheet [ <!ENTITY nbsp "&#x00A0;"> ]> 
<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" 
    exclude-result-prefixes="msxml umbraco.library"> 

<xsl:output method="xml" omit-xml-declaration="yes" /> 

<xsl:param name="currentPage"/> 

<xsl:template match="/"> 

    <xsl:call-template name="drawNodes"> 
    </xsl:call-template> 

</xsl:template> 

<xsl:template name="drawNodes">  
    <ul>  
    <xsl:for-each select="$currentPage/ancestor-or-self::root/node [string(data[@alias='posizione_menu']) = 'left']"> 

     <xsl:choose> 
     <xsl:when test="$currentPage/ancestor-or-self::node/@id = current()/@id"> 
      <li><xsl:value-of select="@nodeName"/></li> 
     </xsl:when> 
     <xsl:otherwise> 
      <li> 
      <a href="{umbraco.library:NiceUrl(@id)}" title="Accedi a {@nodeName}"> 
       <xsl:text disable-output-escaping="yes"><![CDATA[&laquo;]]> </xsl:text> 
       <xsl:value-of select="@nodeName"/> 
      </a> 
      </li> 
     </xsl:otherwise> 
     </xsl:choose> 
    </xsl:for-each> 

    </ul> 

</xsl:template> 
</xsl:stylesheet> 
+0

どのような言語、どのプラットフォーム、詳細に進んでください。 –

+0

あなたがしていることのコードを表示してください。 – fARcRY

+0

    ます。 < XSL:テスト= "$ currentPageに/祖先-または自己::ノード/ @ IDを=現在()/ @ IDの">
  • ます。
  • 選択= "@ノード名"-の値< XSL:特に>

答えて

0

マクロを再利用したい場合は、マクロを再利用したい.NETマスターページに挿入すると簡単にマクロを再利用できます。

別のXHTMLマークアップが左右にあるかどうかによって必要な場合は、お知らせください。

ウォーレン:)

関連する問題