We Are SERIOUSLY in Need Of Some Definitive Examples!
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.
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.
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 :) )
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. :)
We Are SERIOUSLY in Need Of Some Definitive Examples!
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:
(Still haven't figure this one out, though I've seen about a dozen different approaches.)
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
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
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. :)
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...
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! :-)
is working on a reply...