apologies for what is, im sure, a rather nooby question. ive tried to search for help but all documentation seems to be in a slightly different syntax than the one im using.
I have two doctypes that i wish to display in a UL list: Article - Html and Article - PDF. html articles link to their url, pdf articles link to their PDF file.
I show the list via a macro on the relevant template as so:
this works except for the second where, wich is just my attempt at explaining what i want to do: limit this foreach to childnodes of the doctype artikelhtml.
the most confusing thing to me is that all referances i can find use XSLT, but this dosent seem to.
List Childnodes differently by doctype
Hello,
apologies for what is, im sure, a rather nooby question.
ive tried to search for help but all documentation seems to be in a slightly different syntax than the one im using.
I have two doctypes that i wish to display in a UL list: Article - Html and Article - PDF.
html articles link to their url,
pdf articles link to their PDF file.
I show the list via a macro on the relevant template as so:
<umbraco:Macro runat="server" language="cshtml">
@inherits umbraco.MacroEngines.DynamicNodeContext
@{ var numberOfItems = 10; }
<ul>
@foreach (var item in @Model.Children.Where("umbracoNaviHide != true").Where("nodeTypeAlias.value(tostring) == Artikelhtml").Take(numberOfItems).OrderBy("UpdateDate")) {
<li><a href="@item.Url">@item.Name</a></li>
}
</ul>
</umbraco:Macro>
this works except for the second where, wich is just my attempt at explaining what i want to do: limit this foreach to childnodes of the doctype artikelhtml.
the most confusing thing to me is that all referances i can find use XSLT, but this dosent seem to.
Can somebody clarify a bit please?
Hi Andreas, I believe this syntax should work:
Thanks a lot Lennart, that solved my problem :)
is working on a reply...