I know that the team behind Umbraco, working on a new version of Umbraco.tv, where they will focus on Razor. But as I said, it´s in beta now, but try have a look.
http://beta.umbraco.tv/ (seems to have little trouble at the moment, when I am writing this post)
I hope these references can help you understand the Razor syntax, and happy Umbraco coding. :)
Oh and I forgot, maybe this Razor dynamic node cheat sheet also the be a very nice help. I must say that I don´t know if it´s 100% up to date, but anyway I think it´s nice to know that the cheat sheet exist.
The methods on the dynamic node cheat sheet are for using DynamicNode which is used in Razor Macros and not if you are using Mvc. However a lot of the methods are the same. e.g. with dynamic node Model.AncestorOrSelf(1) in Mvc would be CurrentPage.AncestorOrSelf(1) for Dynamics or Model.Content.AncestorOrSelf(1) for Typed.
Additionally the full Mvc documentation can be found here and a there are a lot of useful code samples for both Razor macro and Mvc for each property editor here (take a look at Media picker for example)
Razor Docs / Book
Are there any good umbraco razor docs, reference sites, or books for Razor beginners?
I'm finding it much, much easier than xslt, but sometimes seem to get stuck on seemingly simple things.
This is the best umbraco razor reference page I have found so far :)
Hi Tizer,
I think you also should have a look on this introductions videos to Razor.
http://umbraco.com/help-and-support/video-tutorials/umbraco-fundamentals/razor.aspx ;
http://umbraco.com/help-and-support/video-tutorials/umbraco-fundamentals/razor-recipes.aspx
I know that the team behind Umbraco, working on a new version of Umbraco.tv, where they will focus on Razor. But as I said, it´s in beta now, but try have a look.
http://beta.umbraco.tv/ (seems to have little trouble at the moment, when I am writing this post)
I hope these references can help you understand the Razor syntax, and happy Umbraco coding. :)
/Dennis
Oh and I forgot, maybe this Razor dynamic node cheat sheet also the be a very nice help. I must say that I don´t know if it´s 100% up to date, but anyway I think it´s nice to know that the cheat sheet exist.
http://our.umbraco.org/projects/developer-tools/razor-dynamicnode-cheat-sheet
/Dennis
Thanks Dennis - can't wait for the vids, but the cheat sheet looks great :)
Hi Tizer,
I would also recommend the O'Reilly "Programming Razor" book, it's quite short but covers all of the syntax available. http://www.amazon.com/Programming-Razor-Jess-Chadwick/dp/1449306764/ref=sr_1_1?s=books&ie=UTF8&qid=1373357195&sr=1-1&keywords=razor
The methods on the dynamic node cheat sheet are for using DynamicNode which is used in Razor Macros and not if you are using Mvc. However a lot of the methods are the same. e.g. with dynamic node Model.AncestorOrSelf(1) in Mvc would be CurrentPage.AncestorOrSelf(1) for Dynamics or Model.Content.AncestorOrSelf(1) for Typed.
Additionally the full Mvc documentation can be found here and a there are a lot of useful code samples for both Razor macro and Mvc for each property editor here (take a look at Media picker for example)
Are you using Webforms or Mvc?
Hope that's all helpful?
Jeavon
Have look at this post to check if you use the old or new Razor: http://our.umbraco.org/projects/backoffice-extensions/digibiz-advanced-media-picker/digibiz-advanced-media-picker/39627-How-to-detect-if-no-items-have-been-picked#comment144735
For MVC this blog might also help: http://umbraco.com/follow-us/blog-archive/2012/10/30/getting-started-with-mvc-in-umbraco-410.aspx
Jeroen
I'm using old Razor I think, all my files have this at the top:
Thanks for the info... its probably best to learn the new :)
The old Razor will be marked deprecated soon and eventually it will be removed from Umbraco completely so learing the new one is better indeed :).
Jeroen
is working on a reply...