Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Hide modes in page editor (targeting, timewarp, design, developer and scaffolding)

ignacio_mancill
Level 2
Level 2

Hello,

I have a request where we need to hide all options except for edit and preview from the mode selector in aem author:

1622280_pastedImage_0.png

Do you know how can we hide this modes (targeting, timewarp, design, developer and scaffolding) for a specific group?

Regards.

1 Accepted Solution
Arun_Patidar
Correct answer by
Community Advisor
Community Advisor

You can check the group via making Ajax request if user is not part of group and you can execute code to disable or hide options.

You just need to write extra JS code in above code to make ajax request and execute code

(function($, $document) {

    "use strict";

// code to make ajax request and get true or false

if(true){

    $(document).on("click", ".editor-GlobalBar-layerSwitcher", function(e) {

    var field = $("button.js-editor-LayerSwitcherTrigger[coral-list-item]");

    if (typeof field !== undefined) {

      field.each(function() {

      if($( this ).val() === "Scaffolding" || $( this ).val()==="Timewarp"){ // can be added targeting,  design, developer

      $( this ).attr("disabled", true);

      }

      });

    }

    });

}

})($, $(document));

View solution in original post

1 Reply
Arun_Patidar
Correct answer by
Community Advisor
Community Advisor

You can check the group via making Ajax request if user is not part of group and you can execute code to disable or hide options.

You just need to write extra JS code in above code to make ajax request and execute code

(function($, $document) {

    "use strict";

// code to make ajax request and get true or false

if(true){

    $(document).on("click", ".editor-GlobalBar-layerSwitcher", function(e) {

    var field = $("button.js-editor-LayerSwitcherTrigger[coral-list-item]");

    if (typeof field !== undefined) {

      field.each(function() {

      if($( this ).val() === "Scaffolding" || $( this ).val()==="Timewarp"){ // can be added targeting,  design, developer

      $( this ).attr("disabled", true);

      }

      });

    }

    });

}

})($, $(document));