x First time here? Check out the FAQ

Come work for Umbraco - The Umbraco HQ are hiring Project managers, .NET developers and DevOps people!

  • Avatar242posts235karma

    We Are SERIOUSLY in Need Of Some Definitive Examples!

    Robert J. Bullock started this topic July 21, 2011 @ 07:31

    I am having a hell of a time figuring out how to do the simplest things with Razor... I think we need an updated, consolidated and definitive set of examples:

    • List child nodes, list by type, date, etc.
    • List sibling nodes, list by type, date, etc.
    • Retrieve & interate all children of root content node.
      (Still haven't figure this one out, though I've seen about a dozen different approaches.)
    • Retrieve and display media.
    • Use parameters with practical examples.
    I realize you can find examples to do all of this, but the WIKI pages on Razor are AWFUL, poorly written and confusing as hell. We just need ONE good page with some simple examples for these routine tasks.


  • Avatar4386posts5181karma
    adminComment with ID: 84357
    Dirk De Grave posted this reply July 22, 2011 @ 08:01

    Hi Robert,

    Have you checked the blog posts about Razor functionality

    Of course it can always get better, but at least you get some more info and practical examples of the Razor functionality. If you can't find the answer to a specific question, just ask and I'm sure you'll get a answer from the community.

     

    Cheers,

    /Dirk


  • Chris Houston posted this reply July 22, 2011 @ 09:04

    Hi Robert,

    When you do find the answer to your questions, do update the Wiki pages you are referring too, that way the next person who is stuck will not go through your pain :)

    ( and that might be me, as I have yet to venture down the Razor route :) )

    Cheers,

    Chris


  • Sebastiaan Janssen posted this reply July 22, 2011 @ 03:04

    First of all, do check the Template editor in Umbraco's backend, there's some predefined scripts in there with loads of comments that will provide a great starting point:

    I must say that Razor in 4.7.1 (beta coming in a couple of weeks) will be loads better and I know there are good blog posts coming from Gareth (who implemented the new functionality). These new bits will make your life as a developer even easier.

    I know that doesn't help much for now, but I have been very keen to reply to all of the questions in this forum, and others are closely monitoring it as well. If you get stuck, just post and you'll soon have an answer. :)


  • Avatar242posts235karma
    Comment with ID: 84424
    Robert J. Bullock posted this reply July 22, 2011 @ 04:16

    Okay, that's weird... those aren't the Razor inline macros I get. I get a much shorter list in that same drop down and I am running 4.7.0...


  • Sebastiaan Janssen posted this reply July 22, 2011 @ 04:28

    Ah yes, I see, I'm using the umbraco.MacroEngines.dll from the latest 4.7.1 nightly. So it's coming, a bit more patience! :-)


Please login or Sign up To post replies