Copied to clipboard

Flag this post as spam?

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


  • Janaka Lakmal 25 posts 72 karma points
    Nov 02, 2011 @ 15:02
    Janaka Lakmal
    0

    Sort order is always 0

    Hi,

    I am trying to get sort order inside "AfterPublish" event but always getting 0. In data file and the database sort order is correct.

     

    Thank you in advance.

     

    Regards,

    Janaka

  • Tim 1193 posts 2675 karma points MVP 3x c-trib
    Nov 02, 2011 @ 17:19
    Tim
    0

    Can you post the code that you're using?

  • Janaka Lakmal 25 posts 72 karma points
    Nov 03, 2011 @ 10:57
    Janaka Lakmal
    0

       public DocumentEventHandler()

        {

            Document.AfterPublish += new Document.PublishEventHandler(Document_AfterPublish);

        }

       void Document_AfterPublish(Document sender, umbraco.cms.businesslogic.PublishEventArgs e)

        {

            LatestUploads.InsertOrUpdateLatestProperties(sender);

            Log.Add(LogTypes.Custom, sender.Id, "Document Before save Raised");

            if (sender.Template > 0)

            {

    //SQLite dbtask

                DatabaseTask dbTask = new DatabaseTask();

                int sortOdr = sender.sortOrder;

                string isHide = sender.getProperty("isMenuHide") ==null ? "0" : String.IsNullOrEmpty(sender.getProperty("isMenuHide").Value.ToString())?"0": sender.getProperty("isMenuHide").Value.ToString();

               //insert to sqlite database

    dbTask.InsertUpdatePages(sender.Id, sender.ContentType.Alias, sender.Text, JSONDocument.IterateThroughNodes(sender), isHide, sortOdr);

            }

        }

  • Janaka Lakmal 25 posts 72 karma points
    Nov 09, 2011 @ 13:40
    Janaka Lakmal
    0

    I get the node from document and user sortOrder of the node which gave me the correct sort order.

     

     

Please Sign in or register to post replies

Write your reply to:

Draft