I have multiple root nodes - just wondering was the best way to navigate to say the b node and grab x property?
Have been using the below - but worried about performance.
var root = Model.AncestorOrSelf(1);
var settings = root.Siblings().FirstOrDefault(x => x.ContentType.Alias == "MyNodeAlias");
var property= settings.Value("MyProperty");
Another option you have, is have a picker on your home node that allows you to pick the settings node.
Then you can do Model.Root().Value<IPublishedContent>("settings") to get the setting node.
All of the suggested options can work, and in reality there isn't much of a performance issue in using Siblings approach as everything is in memory anyway.
Multiple Root nodes - get property
I have multiple root nodes - just wondering was the best way to navigate to say the b node and grab x property?
Have been using the below - but worried about performance.
You could try this and compare performance.
Another option you have, is have a picker on your home node that allows you to pick the settings node.
Then you can do
Model.Root().Value<IPublishedContent>("settings")
to get the setting node.All of the suggested options can work, and in reality there isn't much of a performance issue in using Siblings approach as everything is in memory anyway.
Thanks
Nik
Any benefit using something like
is working on a reply...