tags:

views:

141

answers:

1

hi is andrea from rome I created a macro for my menu on the left and it is ok

I would use the same macros for the menu to the right without creating another, help me, there can, What should I do? thanks so much

<?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>
A: 

Hello Andrea, If you want to reuse a macro you can easily do so by inserting into the .NET masterpage where you want to reuse it.

If you want different XHTML markup depending if it is on the left and right please let me know so I can help you out further.

Warren :)

Warren Buckley