Copied to clipboard

Flag this post as spam?

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


  • Andrew Hawken 59 posts 116 karma points c-trib
    Sep 29, 2015 @ 12:52
    Andrew Hawken
    0

    Ordinal Position of node during publish

    I'm hooking into the

    private void ContentServicePublished(IPublishingStrategy sender, PublishEventArgs<IContent> args)
    

    and want to get the ordinal position of each node in args.PublishedEntities (i.e. so I know that this node is the 3rd child in the tree.

    Is there a way to do that?

  • Kevin Jump 2342 posts 14889 karma points MVP 8x c-trib
    Sep 29, 2015 @ 19:02
    Kevin Jump
    0

    Hi

    i think you can access the sortOrder value to see where something is in a list.

    foreach (var item in args.PublishedEntities)
    {
       var order =  item.SortOrder
    }
    

    I think that should give you the position of the item in the tree.

  • Andrew Hawken 59 posts 116 karma points c-trib
    Oct 05, 2015 @ 16:28
    Andrew Hawken
    0

    Many thanks for that - worked perfectly (apologies for the delay in replying - got dragged onto something else for a bit!)

Please Sign in or register to post replies

Write your reply to:

Draft