Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I'm trying to learn razor but keep running into stupid hurdles like this one ;) (I'm thinking this won't be the last post with that intro :D)
Now, a simple listing of children isn't hard to do - Umbraco even supplies a sample snippet. But what if I want to do something like this:
<xsl:for-each select="umbraco.library:GetXmlNodeById(xxxx)/*/* [@isDoc]"> <xsl:if test="position() < 6"> <xsl:value-of select="@nodeName" /> </xsl:if> </xsl:for-each>
How would that look like in razor?
Kind regards, Bruno
Something like:
@foreach(var grandchild in Umbraco.TypedContent(xxxx).Children().SelectMany( c => c.Children()).Take(6)){ @grandchild.Name }
is working on a reply...
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.
Continue discussion
xslt to razor help - simple listing grandchildren
I'm trying to learn razor but keep running into stupid hurdles like this one ;) (I'm thinking this won't be the last post with that intro :D)
Now, a simple listing of children isn't hard to do - Umbraco even supplies a sample snippet. But what if I want to do something like this:
How would that look like in razor?
Kind regards, Bruno
Something like:
is working on a reply...
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.