Node.Children.Where("Visible") picking up hidden nodes in the returned nodes
Got some really odd things happening and it seems to have started since we moved some nodes around.
After moving some nodes and adding new ones (at the same node level to re-organise content) its completely screws the sort order. It ended up looking like:
0 0 0 0 0 6 6 6
hmmm sign of the devil at work maybe! lol
So What i did was to simply re-sort the nodes from th parent tand this sorted everything out nicely.
However when I now perform this query on the the parent node (im buildng custom menus):
@foreach (var item in Node.Children.Where("Visible and SortOrder > 5 "))
The resulting collection of nodes contains nodes that are not visible!!! Quite alarming.
I have now had to implement a further check within the foreach to check whether the node is visible with:
if (@item.Visible)
which weeds out the offending nodes!
What i need to know is whats going on here!! Its really odd.
But like i said my gut feeling is its related to moving nodes around and re-indexing the sort order.
I believe this purely down to the sort index getting mucked up when you move nodes.
Could it be possible to auto re-sort the nodes at the source and dest based on their current order after a move, delete or copy as i think it is an issue - all be it one with a workaround?
Node.Children.Where("Visible") picking up hidden nodes in the returned nodes
Got some really odd things happening and it seems to have started since we moved some nodes around.
After moving some nodes and adding new ones (at the same node level to re-organise content) its completely screws the sort order. It ended up looking like:
0 0 0 0 0 6 6 6
hmmm sign of the devil at work maybe! lol
So What i did was to simply re-sort the nodes from th parent tand this sorted everything out nicely.
However when I now perform this query on the the parent node (im buildng custom menus):
@foreach (var item in Node.Children.Where("Visible and SortOrder > 5 "))
The resulting collection of nodes contains nodes that are not visible!!! Quite alarming.
I have now had to implement a further check within the foreach to check whether the node is visible with:
if (@item.Visible)
which weeds out the offending nodes!
What i need to know is whats going on here!! Its really odd.
But like i said my gut feeling is its related to moving nodes around and re-indexing the sort order.
Forgot to add this is 4.7.1
And also point out I am using the umbracoNaviHide variable.
I think you need to use umbracoNaviHide instead of umbNaviHide.
Jeroen
oops - sorry ! it is umbracoNaviHide. Did that from memory! :)
I believe this purely down to the sort index getting mucked up when you move nodes.
Could it be possible to auto re-sort the nodes at the source and dest based on their current order after a move, delete or copy as i think it is an issue - all be it one with a workaround?
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.