Copied to clipboard

Flag this post as spam?

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


  • Hash 2 posts 22 karma points
    Dec 07, 2011 @ 08:05
    Hash
    0

    Disable Save and Publish button in admin side

    Do we have any option to disable the save and publish button available in umrbaco programmatically.?

  • Daniel Bardi 927 posts 2562 karma points
    Dec 14, 2011 @ 04:58
    Daniel Bardi
    0

    You can cancel the save and publish actions by attaching to the BeforeSave and BeforePublish events.

      public class SavePublishHandler : ApplicationBase
        {
            public SavePublishHandler()
            {
                Document.BeforeSave += Document_BeforeSave;
                Document.BeforeSendToPublish += Document_BeforeSendToPublish;
            }

            private void Document_BeforeSendToPublish(Document sender, umbraco.cms.businesslogic.SendToPublishEventArgs e)
            {
                e.Cancel = true;
            }

            private void Document_BeforeSave(Document sender, umbraco.cms.businesslogic.SaveEventArgs e)
            {
                e.Cancel = true;
            }
    }
  • Jonathan Roberts 409 posts 1063 karma points
    Nov 01, 2016 @ 09:29
    Jonathan Roberts
    0

    Is there any new code that we can use to replace the Save and Publish button using 7.5? Thanks

    Jon

Please Sign in or register to post replies

Write your reply to:

Draft