Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Damian Green 452 posts 1433 karma points
    Feb 16, 2012 @ 11:41
    Damian Green
    0

    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.


  • Damian Green 452 posts 1433 karma points
    Feb 16, 2012 @ 11:43
    Damian Green
    0

    Forgot to add this is 4.7.1

     

  • Damian Green 452 posts 1433 karma points
    Feb 16, 2012 @ 12:55
    Damian Green
    0

    And also point out I am using the umbracoNaviHide variable.

  • Jeroen Breuer 4861 posts 12138 karma points MVP 3x admin c-trib
    Feb 16, 2012 @ 13:02
    Jeroen Breuer
    0

    I think you need to use umbracoNaviHide instead of umbNaviHide.

    Jeroen

  • Damian Green 452 posts 1433 karma points
    Feb 16, 2012 @ 13:06
    Damian Green
    0

    oops - sorry ! it is umbracoNaviHide.  Did that from memory! :)

     

  • Damian Green 452 posts 1433 karma points
    Mar 15, 2012 @ 12:18
    Damian Green
    0

    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?

     

     

  • 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.

Please Sign in or register to post replies