Umbraco macros in the menu

I created a macro for my left menu and that's ok.

I want to use the same macros for the menu on the right without creating another one.

What should I do?

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


a source to share


1 answer


If you want to reuse a macro, you can easily do so by pasting it into the .NET master page where you want to reuse it.

If you want different XHTML markup depending on whether it's on the left or right, please let me know so I can help you further.



Warren :)

0


a source







All Articles