Copied to clipboard

Flag this post as spam?

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


  • Dave Woestenborghs 2340 posts 6543 karma points mvp c-trib
    Oct 31, 2011 @ 13:32
    Dave Woestenborghs
    0

    Macro creation support

    Hi,

    When I look at the source code there is a lot of work done for creating macro definitions in Umbraco. When will this be released ?

  • Vladan Ostojic 94 posts 205 karma points
    Oct 31, 2011 @ 13:43
    Vladan Ostojic
    0

    Hi,

    Can you tell me what exactly do you mean when talking about macro definitions? uSiteBuilder already supports (released from the first version) automatic creation of Macros for your web user controls: just add attribute 'Macro' to your user control and set its values. You can also set 'MacroParameter' attribute on some of public properties in your user control.

  • Dave Woestenborghs 2340 posts 6543 karma points mvp c-trib
    Oct 31, 2011 @ 13:52
    Dave Woestenborghs
    0

    I mean creating macro's for xslt, webcontrols, razor, etc...

    If I look in the source code on codeplex I see that a lot of code is available in the MacroBuilder folder, but it's not available in the distruted assembly.

  • Vladan Ostojic 94 posts 205 karma points
    Oct 31, 2011 @ 14:19
    Vladan Ostojic
    0

    As I mentioned, uSiteBuilder supports only automatic creation of macros if you add Macro attribute to user control and that's what that code is about. It is released from the first version but there is no reason that you use that API directly - uSiteBuilder will use it when you add mentioned attributes to user controls and its properties.

    Automatic macro creation for xslt's and razor files is not there yet as there is no straightforward way to describe macro there (there's no metadata mechanism as there are attributes on user controls).

  • Dave Woestenborghs 2340 posts 6543 karma points mvp c-trib
    Oct 31, 2011 @ 14:26
  • Vladan Ostojic 94 posts 205 karma points
    Oct 31, 2011 @ 14:37
    Vladan Ostojic
    0

    I see. Most that code is obsolete and for now we are not planning to develop it further.

  • Dave Woestenborghs 2340 posts 6543 karma points mvp c-trib
    Oct 31, 2011 @ 14:38
    Dave Woestenborghs
    0

    That's a shame. Espiccialy with razor being so popular at the moment

  • Vladan Ostojic 94 posts 205 karma points
    Oct 31, 2011 @ 14:50
    Vladan Ostojic
    0

    Well we may support razor if there is enough interest but supporting xslts and phyton is currently not the plan.

    Also, I think that using uSiteBuilder as rendering engine if by far better than razor (if you are Visual Studio developer) as uSiteBuilder provides strongly typed way of rendering compared with razor that is done during runtime. You can find more details about rendering here http://usitebuilder.vegaitsourcing.rs/tutorials?id=22391 and on this image you can see an example: http://usitebuilder.vegaitsourcing.rs/media/2641/image3.png

  • Justin Spradlin 137 posts 345 karma points
    Nov 07, 2011 @ 22:07
    Justin Spradlin
    0

    I have actually been using a hybrid approach. I use uSiteBuilder for document types and templates, so I can easily version control and deploy them. I then use the dynamic razor to render my nodes. I have been using the umbraco:macro server control to render my razor scripts without the need for a dedicated macro.

     <umbraco:Macro runat="server" FileLocation="~/macroscripts/AboutPage.cshtml" />

     I agree that is is much easier to have a strongly typed interface, but the flexibility and ease of use for razor wins for me. This is a snipped used for my site's new ticker.

    <div class="news-home">
        <div class="inner">
            <h2>News</h2>       
            <ul>
            @foreach (var article in Model.AncestorOrSelf().XPath(@"//NewsArticle"))
            {
                <li><a href="@article.Url">@article.TeaserText | @article.UpdateDate.ToString("MMMM dd,yyyy")</a></li>
            }
            </ul>
        </div>         
        <div class="clear"></div>                    
    </div>
  • Barry Fogarty 465 posts 972 karma points
    Nov 07, 2011 @ 22:27
    Barry Fogarty
    0

    Vladan, I also follow Justin's model.  Razor provides a really simple way to achieve a lot of common functionality.  Also, Niels announced at the UK festival that razor will become the de facto standard for Umbraco from v5 - and once they move to the MVC architecture I dont think ASCX will be used at all for functionality components (I may be wrong).  I realise that when this time comes uSiteBuilder will change dramatically - anyway just wanted to add my voice for razor support in uSiteBuilder.

    Keep up the great work with the tool.

  • Vladan Ostojic 94 posts 205 karma points
    Nov 10, 2011 @ 17:34
    Vladan Ostojic
    0

     

    I wrote this on another topic but it's also related with this topic: we found a nice way to support Razor in uSiteBuilder and offer stongly typed views with uSiteBuilder & Razor! Soon we'll post more details. I'm sure you'll like it and I hope that some of you guys will be able to do test before we officially release it!

     

  • Dave Woestenborghs 2340 posts 6543 karma points mvp c-trib
    Nov 10, 2011 @ 18:02
    Dave Woestenborghs
    0

    Would love to tes it

  • Justin Spradlin 137 posts 345 karma points
    Nov 10, 2011 @ 18:38
    Justin Spradlin
    0

    I can help test it. I am creating a new site using ALL razor + uSiteBuilder in the evenings. I just got started, so I am not too far down the road to throw in some testing. Let me know if I can help out.

    Thanks,

    Justin 

  • Douglas Ludlow 210 posts 364 karma points
    Dec 09, 2013 @ 23:05
    Douglas Ludlow
    0

    Is there any update on this? Are there any code samples for creating razor scripts in umbraco?

Please Sign in or register to post replies

Write your reply to:

Draft