Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Connie DeCinko 931 posts 1160 karma points
    Oct 01, 2010 @ 18:42
    Connie DeCinko
    0

    Conditional macro in master template

    How would I display a macro in my master template based upon a node or folder name?

    For example, for main site use <umbraco:Macro Alias="getMainMenu" runat="server"></umbraco:Macro> but for /es/ (Spanish) portions, use <umbraco:Macro Alias="getMainMenu-Spanish" runat="server"></umbraco:Macro>

     

  • Lennart Stoop 304 posts 842 karma points
    Oct 01, 2010 @ 19:28
    Lennart Stoop
    0

    Hi Connie,

    I would probably stick to just one macro in the template, and handle the logic for the Spanish menu in the XSLT.

    If that logic is too complex, you could use the <xsl:include href="GetMainMenu-Es.xslt" /> and include the appropriate XSLT based on the active language.

    Grtz

    Lennart

  • Connie DeCinko 931 posts 1160 karma points
    Oct 01, 2010 @ 19:41
    Connie DeCinko
    0

    Yeah, after I posted the message, I thought that a single macro with conditions inside would be an acceptable solution.  Now, I'm just trying to figure out the XSLT to determine which "parent" node the page is under.

     

Please Sign in or register to post replies

Write your reply to:

Draft