I don't know if it was implemented like this in previous versions of the Razor implementation in Umbraco though but since you're coming from an XSLT background you have probably been using the @nodeTypeAlias attribute a lot previously, which may be the reason why you tried calling it the same in Razor? I know I still tend to do that myself since it's confusing that it's now called something else :)
Lol, i actually got it from a post from Dennis himself... :) (im not going to link to it, since it aparrently not correct any more)
What makes me confused though, is that NodeTypeAlias "sort of" works... It doesn't fail completely, but doesnt work as expected... That must throw a lot of people. I'm gonna download the cheat sheets again :). I had them printed out earlier as a reference on my desk, but they have gone missing :).
The example you are refers to where Clare need to listing nodes of multiple doc types uses the old DynmaicNode Razor, and I think the DocumentTypeAlias is introduced when you are using partial view macros or parial views. Can´t remember if it´s only when you are using Umbraco 7
Listing nodes of multiple doc types
Im trying to list sub nodes of specific doc types. I got this:
But his will only render the first declared doc type, here "Personliste". I dont really get why that is...
Hi Claus,
What if you do something like this would this work ?.
I can see from the code that you are not using the old legacy Razor,
Hope this helps,
/Dennis
Yes, that works.
But why Does my example (lifted from another thread) not work?
Whats the difference between NodeTypeAlias and DocumentTypeAlias?
Is NodeTypeAlias deprecated?
Hi Claus
Just to chime in - I don't know if you have seen the Razor cheatsheet for v6 - It works for v7 too. You can find it here https://our.umbraco.org/projects/developer-tools/umbraco-v6-mvc-razor-cheatsheets - As you can see there is no "NodeTypeAlias" option in there.
I don't know if it was implemented like this in previous versions of the Razor implementation in Umbraco though but since you're coming from an XSLT background you have probably been using the @nodeTypeAlias attribute a lot previously, which may be the reason why you tried calling it the same in Razor? I know I still tend to do that myself since it's confusing that it's now called something else :)
/Jan
Lol, i actually got it from a post from Dennis himself... :)
(im not going to link to it, since it aparrently not correct any more)
What makes me confused though, is that NodeTypeAlias "sort of" works... It doesn't fail completely, but doesnt work as expected... That must throw a lot of people. I'm gonna download the cheat sheets again :). I had them printed out earlier as a reference on my desk, but they have gone missing :).
Hi Claus,
The example you are refers to where Clare need to listing nodes of multiple doc types uses the old DynmaicNode Razor, and I think the DocumentTypeAlias is introduced when you are using partial view macros or parial views. Can´t remember if it´s only when you are using Umbraco 7
Hope this helps,
/Dennis
Glad to see im not the only one who's a bit unsure :)
Hi Claus
Did you figure this out at the end?
I am trying to do a similar thing and it doesnt seem to work on 2nd literal, posted full details at another post here
Yeah, if you read above: NodeTypeAlias doesnt work, it should be DocumentTypeAlias
Hi Claus
I could swear it didnt work the first time when I tried the alternative...
Changing to DocumentTypeAlias works indeed.
Many thanks for taking time to reply.
is working on a reply...