4

Does anyone know how I can add a custom strip menu item in the Sitecore toolbar? Normally we will have Home, Navigate, Review, Publish, Version, Configure, Presentation in the toolbar. But I want to create another strip item called Sync, and then put several ribbon buttons inside it. Also the Sync menu should only display when the author clicks on the Headless Site, otherwise I would like to hide it.

enter image description here

Thank you so much

1
  • 1
    You should absolutely not do this on XM Cloud. Please reach out to the partner technical advisor team working with you on your XM Cloud project.
    – Richard Seal
    Commented Jan 3 at 19:38

1 Answer 1

1

You can follow these steps you create a menu like this and add buttons to it.

  • Go to the core database.

  • Under /sitecore/content/Applications/Content Editor/Ribbons/Contextual Ribbons/ you need to create a toolbar for example "Social" based on /sitecore/templates/System/Ribbon/Toolbar template

  • Under /sitecore/content/Applications/Content Editor/Ribbons/Contextual Ribbons/Social you have to create a Social strip based on /sitecore/templates/System/Ribbon/Strip template.

  • Under /sitecore/content/Applications/Content Editor/Ribbons/Contextual Ribbons/Social/Social you have to create a Social chunk based on /sitecore/templates/System/Ribbon/Chunk template. It will look like this.

enter image description here

  • Finally, you can create commands on your button.

The output will look like this.

enter image description here

To hide the menu, you can go to the item and add the security of read/write.

For more details of command and action, you can refer to this link.

https://tothecore.sk/2018/05/31/adding-custom-social-buttons-to-content-editor-in-sitecore-9/

Hope this helps.

3
  • Hi Sumit, thank for detailed answer. I'm able to make it visible on toolbar now, but still figuring out how to hide the menu based on whether site has been clicked or not. From what I found out, Security is only about user-based permission, if we want to have a conditional rendering for the toolbar, we have to define a ruleset or something like that
    – rayray
    Commented Jan 4 at 5:22
  • Yes, you are right, but to hide a menu when you click on a particular site item will require a lot of customization. Like, on an item click event, you need to write the code and then bind that event with Sitecore configuration. I hope this answers your question. If you think you get sufficient details please accept the answer. @rayray Commented Jan 4 at 11:42
  • This is not a good approach for XM Cloud.
    – Richard Seal
    Commented Jan 4 at 13:50

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.