I wrote a blog post about this - Using Razor in Umbraco 4.7. It includes some useful background links too (in the related links panel on left). Once you've got the basics I did another post on more advance techniques such as pagination and using helpers - Creating a Paged List in Umbraco using Razor. Hope they are of some use to you?
Short answer: no, anything that can be done in xslt can be done in Razor and vice versa. It's just considering using the right tool for the right job. For example, if you need to fetch some xml from an external source and operate on that data, I'd seriously consider using xslt instead of Razor... Anyway, if you feel much more comfortable in c#, then Razor is perfect as the learning curve is much lower than xslt (at least, it is for me)
It will give you a good idea of what it can do. Although, if you want to follow along you'll have to use a 4.7.1 nightly (http://nightly.umbraco.org/umbraco%204.7/4.7%20RC/) because I'm showing new functionality that's not yet in 4.7.0.
Learning Razor fundamentals
I have been away from Umbraco for a while, so my knowledge kind of stops just before 4.5.
I have been trying to find a good place to start reading about the simple fundamental things about Razor, but i havent yet found what i'm looking for.
What i need is the real basic stuff like what is it ? how to use it ? etc.
Any pointers would be a great help for me.
Thanks
Mikael
Are you in a big hurry? I'm writing a blog post exactly about this over the weekend.
A few pointers: http://www.asp.net/webmatrix/tutorials/2-introduction-to-asp-net-web-programming-using-the-razor-syntax
And a slightly outdated introduction by Aaron: http://www.aaron-powell.com/umbraco-4-and-razor
Hi Mikael,
You could start here: http://our.umbraco.org/wiki/reference/code-snippets/razor-snippets
Cheers,
/Dirk
I wrote a blog post about this - Using Razor in Umbraco 4.7. It includes some useful background links too (in the related links panel on left). Once you've got the basics I did another post on more advance techniques such as pagination and using helpers - Creating a Paged List in Umbraco using Razor. Hope they are of some use to you?
i hope with 4.7.1 someone will write a full documentation to razor.
Thanks guys.
I found Arons intro stuff here: http://www.aaron-powell.com/umbraco-4-and-razor
It has already given me a ultra basic understanding. And i like what i see.
I was never a XSLT fanboy, i found the syntax confusing and often had to search the forum for other peoples code and adopt it for my purpose.
Razor syntax looks like it is more readable and more logic.
Are there anay limitations, like stuff you can't do in Razor but can do in XSLT?
Short answer: no, anything that can be done in xslt can be done in Razor and vice versa. It's just considering using the right tool for the right job. For example, if you need to fetch some xml from an external source and operate on that data, I'd seriously consider using xslt instead of Razor... Anyway, if you feel much more comfortable in c#, then Razor is perfect as the learning curve is much lower than xslt (at least, it is for me)
Hope this helps.
Regards,
/Dirk
Make sure to also watch my CodeGarden session, all about Razor:
http://codegarden11.com/sessions/day-1/slot-three/macros-xslt-the-razor-way.aspx
It will give you a good idea of what it can do. Although, if you want to follow along you'll have to use a 4.7.1 nightly (http://nightly.umbraco.org/umbraco%204.7/4.7%20RC/) because I'm showing new functionality that's not yet in 4.7.0.
is working on a reply...