0

左側のメニューのマクロを作成しましたが、問題ありません。

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

私は何をすべきか?

<?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>
4

1 に答える 1

0

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

左右に異なるXHTMLマークアップが必要な場合は、お知らせください。さらにサポートさせていただきます。

ウォーレン:)

于 2009-05-26T10:03:46.057 に答える