Copied to clipboard

Flag this post as spam?

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


  • Mikael Mørup 297 posts 326 karma points
    Jul 08, 2011 @ 09:51
    Mikael Mørup
    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

     

  • Sebastiaan Janssen 5061 posts 15544 karma points MVP admin hq
    Jul 08, 2011 @ 10:24
    Sebastiaan Janssen
    0

    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

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Jul 08, 2011 @ 10:24
    Dirk De Grave
    0

    Hi Mikael,

    You could start here: http://our.umbraco.org/wiki/reference/code-snippets/razor-snippets

     

    Cheers,

    /Dirk

  • Dan Diplo 1554 posts 6205 karma points MVP 6x c-trib
    Jul 08, 2011 @ 10:34
    Dan Diplo
    0

    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?

  • Eran Meir 401 posts 543 karma points
    Jul 08, 2011 @ 10:39
    Eran Meir
    0

    i hope with 4.7.1 someone will write a full documentation to razor.

  • Mikael Mørup 297 posts 326 karma points
    Jul 08, 2011 @ 10:39
    Mikael Mørup
    0

    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?

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Jul 08, 2011 @ 10:44
    Dirk De Grave
    0

    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

  • Sebastiaan Janssen 5061 posts 15544 karma points MVP admin hq
    Jul 08, 2011 @ 11:04
    Sebastiaan Janssen
    0

    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.

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies