Blog about tips & tricks for CMS enhancement


Hide the Edit Approval Sequence context menu

As questioned at the forums of Episerver World, there is no included setting for disabling the Approval Definition in Episerver. If not used by your customer, it is quite useless to include it in the context menu of the site tree.

Here is how to disable it. This was made in Episerver CMS 11.5 version.

The code

Add this to your module.config file on the root level of your project - which will let us control the initial request of the Episerver edit mode:

<?xml version="1.0" encoding="utf-8"?>
    <add assembly="EpiserverPlayground" />
      <add name="app" path="Scripts" />
  <clientModule initializer="app.Initializer">
      <add dependency="CMS" type="Require RunAfter" />

And then with the help of [lang in Dojo] ( we will override the built in Episerver "isAvailable" for Approval Context Menu and set it to false instead. Put this in a file called "Initializer.js" under your ~/ClientResources/Scripts/ folder:

    // Dojo
    // CMS
], function (declare, lang, _Module, EditApprovalDefinition) {

    return declare("app.Initializer", [_Module], {

        initialize: function () {
        _overrideContentApprovalDefinition: function () {
            lang.extend(EditApprovalDefinition, {
                _enableContentApprovalMenuContext: EditApprovalDefinition.prototype._enableContentApprovalMenuContext,
                _setEnabledState: function () {
                    this.set("isAvailable", false);

The result

The edit approval menu should now be hidden from the context menu: