0

We would like to disable Publish button under the home menu in experience editor for admin users as well in Sitecore SXA.

Tried approach : I went to core database /sitecore/content/Application/webedit/ribbons/webedit/Experience Editor /publish/publish path and tried to remove click textbox text (item:publish(id=$Target) After that I am still able to see the functionality.

I have a requirement to remove the functionality of the click event, not the button. When I am clicking on publish button then it shows the publish item popup. I don't want to open this functionality.

1
  • In my opinion this seems unnecessary. Admins should not be poking around editing content. Perhaps this is an issue with granting too much access to users. Apr 26, 2023 at 12:55

2 Answers 2

2

I know this is not a good solution but If you don't want this functionality anymore or completely remove this then one thing you can do is delete or rename or update the code in the JS file that is handling this click event from your Sitecore application root.

Here is the location of this file.

wwwroot\<your-appplication-root>\sitecore\shell\client\Sitecore\ExperienceEditor\Commands\Publish.js

And it will stop the publish functionality.

I will suggest you to modify the JS written in this file on the click event and just use return in the functions.

After modifying your changes, run the application in incognito mode to verify the latest changes. Then it will reflect.

Hope this will work.

1

It's not possible out of the box but there are a couple of ways you can try out.

  1. Custom Command to restrict the Publish button. Refer this for more details (Link)
  2. Use Rules Engine to control show/hide. Refer this for more details (Link)
  3. Not recommended - Delete item /sitecore/content/Application/webedit/ribbons/webedit/Experience Editor /publish/publish

Hope it helps!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.