Thanks Edwin, I kow how to get descendants of a node, I need to get the list out of collection in this case. It's a matter of correct cast I guess, can't get it to work though.
My question is not what type of list I want but how to get this list from a collection which I get from Tag.GetNodesWithTags() (I'm not using node.Descendants or node.Children here),
Sorry if it's not clear, but my initial question explains it.
How to get a list of nodes by document type from IEnumerable
Hi guys,
I need to get a list of nodes by type from a list which I get from Tags:
@using umbraco.MacroEngines
@using umbraco.cms.businesslogic.Tags
var matchingNodes = Tag.GetNodesWithTags(searchFor).ToList();
Tag.GetNodesWithTags() returns IEnumerable<CMSNode>
I'm trying to do it something like this, but have no luck:
var debates = matchingNodes.Where(t => t.NodeTypeAlias.Equals("Debate"));
How can I do it? Thanks!
I'm doing it like this but i don't know if it's the right way?
DynamicNode Root = new DynamicNode(-1);
ViewBag.NewsItems = Root.Descendants("NewsDetail").Where(x => x.Visible).OrderByDescending(x => x.CreateDate).Take(3);
Thanks Edwin, I kow how to get descendants of a node, I need to get the list out of collection in this case. It's a matter of correct cast I guess, can't get it to work though.
It return IEnumerable<DynamicNode> so i don't understand what kind of list you want?
My question is not what type of list I want but how to get this list from a collection which I get from Tag.GetNodesWithTags() (I'm not using node.Descendants or node.Children here),
Sorry if it's not clear, but my initial question explains it.
Sorry, same here. I'm just a beginner and never used tags.
is working on a reply...