Is there a way where i don't have to loop trough all nodes and then check for this selected item in the multinode tree picker, so that i only loop trought the nodes where this condition is true?
my idea would be something like (pseudocode):
@foreach (var eachKomposition in Umbraco.Content(1075).Children().Where(Value("komponist")[0].Id == Model.Content.Id)
Get Nodes with Where Clausel by MultiNodeTreePicker
Hello Umbraco Community
I have a problem with looping trough about 1400 nodes. Its very slow and my page has long loading-times.
The thing is that i only need the nodes where at the "Multinode Treepicker" is picked the current page. which is this Statement at the moment:
Here is the full code:
Is there a way where i don't have to loop trough all nodes and then check for this selected item in the multinode tree picker, so that i only loop trought the nodes where this condition is true?
my idea would be something like (pseudocode):
@foreach (var eachKomposition in Umbraco.Content(1075).Children().Where(Value("komponist")[0].Id == Model.Content.Id)
is there a way to do this?
thanks in advance for helping
Kind regards Hubert
Hi Hubert,
Below query will help you. @foreach (var eachKomposition in Umbraco.Content(1075).Children().Where(x=> x.HasValue("komponist") && x.GetPropertyValue<>
// Above is more of a pseudo but will give you the logic to use.
In addition, please try and use Html.CachedPartial and get this code inside that partial so it is all cached.
This will reduce the repeated workload for your server and make site much fast.
Cheers, Shaishav
Thanks i will give this query a try.
And with Html.CachedPartial how often will the cache be refreshed? Everytime i publish a new node/edit a node? Or is this in a timespan?
is working on a reply...