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.
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.
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).
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.
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.
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.
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!
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.
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 ?
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.
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.
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).
Hi Vladan,
The code you mention is in the webusercontrolbuilder
I'm referring to the code in the MacroBuilder Folder.
http://usitebuilder.codeplex.com/SourceControl/changeset/view/80766#1781297
http://usitebuilder.codeplex.com/SourceControl/changeset/view/80766#1781278
http://usitebuilder.codeplex.com/SourceControl/changeset/view/80766#1781266
I see. Most that code is obsolete and for now we are not planning to develop it further.
That's a shame. Espiccialy with razor being so popular at the moment
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
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.
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.
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.
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!
Would love to tes it
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
Is there any update on this? Are there any code samples for creating razor scripts in umbraco?
is working on a reply...