Copied to clipboard

Flag this post as spam?

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


  • Mahender Singh 39 posts 171 karma points
    Aug 11, 2023 @ 05:57
    Mahender Singh
    0

    Override Umbraco Editor SaveandPublish button functionality

    Hi Team,

    I want to override SaveandPublish button functionality. whenever any editor add or update any content for specific document type then i need to do some extra data analysis and then save it.

    So could you please help me to know, how can i override it for specific document type.

  • Marc Goodson 2155 posts 14408 karma points MVP 9x c-trib
    Aug 11, 2023 @ 08:57
    Marc Goodson
    101

    Hi Mahender

    Whenever content is saved or published in Umbraco, different notifications are broadcast.

    https://docs.umbraco.com/umbraco-cms/reference/notifications/contentservice-notifications

    You can then write code to subscribe to these noitificatiins and do your custom stuff, or in some cases cancel the saving or publishing.

    Regards

    Marc

  • Mahender Singh 39 posts 171 karma points
    Sep 15, 2023 @ 07:45
    Mahender Singh
    0

    Hi Marc,

    Thanks for your help. But issue with this solution is INotificationHandler class execute when website load and when editor publish any content.

    But I need solution, in which when editor publish any content then only function execute not when website load. If i use this solution then website taking more time to load.

    So please help me in that case.

  • Marc Goodson 2155 posts 14408 karma points MVP 9x c-trib
    Sep 18, 2023 @ 11:42
    Marc Goodson
    0

    Hi Mahender

    There are other notifications too... further down in the page..

    If I want to do some extra analysis of what has been entered then I tend to handle this when the editor has made the content update, so I would normally use the 'ContentSavingNotification' - that way the editor is made aware of the problem when it is created, rather than a later date if they are not immediately publishing...

    (That said the 'ContentPublishingNotification' should only be fired when an editor presses publish on a page, not when the site starts up, and builds the published cache, but maybe there is a bug with Vlatest Umbraco as I've not seen this before)

    Anyway, give ContentSavingNotification a try!

    regards

    Marc

Please Sign in or register to post replies

Write your reply to:

Draft