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
Hi,
I want to query my web to get the name of all the nodes from a specific document type. My problem is that my tree is like this:
where the yellow root can be repeated N times.
How can I get all my yellow roots to load the names of them in a navbar in my Index root?
Hi Daniel,
What version of Umbraco are you using. Are you using Modelsbuilder ?
Dave
I am using Umbraco 8.6 without Modelsbuilder.
After several months I found a solution to my problem.
The right way to get all nodes of the same type is with:
var roots = Model.Root().Siblings().ToList()
You can also filter your list to get the nodes with a specific alias:
var roots= Model.Root().Siblings().Where(x => x.ContentType.Alias == "aliasToLookFor");
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
Get nodes by documentType from different roots
Hi,
I want to query my web to get the name of all the nodes from a specific document type. My problem is that my tree is like this:
where the yellow root can be repeated N times.
How can I get all my yellow roots to load the names of them in a navbar in my Index root?
Hi Daniel,
What version of Umbraco are you using. Are you using Modelsbuilder ?
Dave
I am using Umbraco 8.6 without Modelsbuilder.
After several months I found a solution to my problem.
The right way to get all nodes of the same type is with:
You can also filter your list to get the nodes with a specific alias:
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.