Copied to clipboard

Flag this post as spam?

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


  • Steven Newstead 62 posts 103 karma points
    Mar 16, 2011 @ 15:30
    Steven Newstead
    0

    uSiteBuilder and Razor

    Hi all,

    Please let me know if I am posting in the wrong area of this one.

    I was just wondering if anyone knew if the uSiteBuilder package is likely to be update to include adding macros that point at Razor files.

    Currently you only seem to be able to add .NET controls as macros.

    Thanks a lot,

    Steve

  • Barry Fogarty 493 posts 1129 karma points
    Jul 12, 2011 @ 00:07
    Barry Fogarty
    0

    Check out Sebastiaan's article, he talks about using razor macros near the end:

    http://cultiv.nl/blog/2011/5/9/umbraco-developer-productivity-with-usitebuilder/

  • Sebastiaan Janssen 5045 posts 15476 karma points MVP admin hq
    Jul 13, 2011 @ 08:14
    Sebastiaan Janssen
    0

    Yup, so what it comes down to: you don't need uSitebuilder for this, just create .cshtml files and define your Razor macro's in your template like this:

    <umbraco:Macro FileLocation="~/macroScripts/MyRazorFile.cshtml" runat="server" />

    Because it is now pointing directly to the file, Umbraco doesn't need a full macro definition. You can even have attributes in this definition to enable caching, etc, everything you can normally do in a macro definition.

  • Steven Newstead 62 posts 103 karma points
    Jan 05, 2012 @ 12:36
    Steven Newstead
    0

    Only just remembered about this, I'd hacked the uSiteBuilder build to allow me to do what I wanted but this makes more sense.

Please Sign in or register to post replies

Write your reply to:

Draft