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
How would I be able to filter the decendants of a node, but have many types.
var Decendants = Page.Descendants("nodeTypeAlias").Where("Visible")
but what I need to do is something like...
var Decendants = Page.Descendants("nodeTypeAlias1,nodeTypeAlias2,nodeTypeAlias3").Where("Visible")
you can check for nodetypes using:
Model.Descendants().Where("NodeTypeAlias == \"nodeTypeAlias1\"");
Checking multiple nodetypes doesn't seem to work, strange...I think it's a bug..
Model.Descendants().Where("NodeTypeAlias == \"nodeTypeAlias1\" || NodeTypeAlias == \"nodeTypeAlias2\" ")
This seems to work:
@{ umbraco.MacroEngines.DynamicNodeList list = Model.Descendants(); string[] nodeTypes = {"nodeTypeAlias1", "nodeTypeAlias2", "nodeTypeAlias3"}; <ul> @foreach(dynamic item in list.Items.Where(x => x.Visible && nodeTypes.Contains(x.NodeTypeAlias))){ <li>@item.Name</li> } </ul>}
Cheers, Richard
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Tree Navigation
How would I be able to filter the decendants of a node, but have many types.
but what I need to do is something like...
you can check for nodetypes using:
Checking multiple nodetypes doesn't seem to work, strange...I think it's a bug..
This seems to work:
@{
umbraco.MacroEngines.DynamicNodeList list = Model.Descendants();
string[] nodeTypes = {"nodeTypeAlias1", "nodeTypeAlias2", "nodeTypeAlias3"};
<ul>
@foreach(dynamic item in list.Items.Where(x => x.Visible && nodeTypes.Contains(x.NodeTypeAlias))){
<li>@item.Name</li>
}
</ul>
}
Cheers, Richard
is working on a reply...