Copied to clipboard

Flag this post as spam?

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


  • Pinal Bhatt 298 posts 390 karma points
    Mar 11, 2011 @ 10:46
    Pinal Bhatt
    0

    How to add macro to master page(template)?

    I am trying to create master page(Template) thru Visual Studio 2010 using uSiteBuilder template. How can I add existing macro to it?

  • kristian schneider 190 posts 351 karma points
    Mar 11, 2011 @ 10:56
    kristian schneider
    1

    Add a macro like this:

     <umbraco:Macro ID="YourMacroID" Alias="YourMacroAlias" runat="server"></umbraco:Macro>
  • Vladan Ostojic 94 posts 210 karma points
    Mar 11, 2011 @ 11:06
    Vladan Ostojic
    1

    To create an Umbraco template you should create standard ASP .NET masterpage. Than in codebehind change base class of your masterpage from MasterPage to Vega.USiteBuilder.TemplateBase<T> where T is your document type that template is rendering.

    To add existing macro to that template, you should just add macro directly in .aspx code of your master page as following:

    <umbraco:Macro Alias="MyMacroAlias" runat="server"></umbraco:Macro>

    where 'MyMarcoAlias' is your macro alias.

  • Pinal Bhatt 298 posts 390 karma points
    Mar 11, 2011 @ 11:06
    Pinal Bhatt
    0

    Ok so similar code as generated by Unbraco backend with additional ID parameter.

    Cool... will try this.

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

    Continue discussion

Please Sign in or register to post replies