Custom Button on Content Details Page in Sitecore Content Hub
In this blog post, I will discuss how to add a custom button on the Content Details page in the Sitecore Content Hub. To understand the use case of this feature, suppose you have a client requirement to perform any business logic on that particular entity for instance updating field values or applying auto-tagging, etc.
1. Go to the pages option from the Manage button in the top right corner of the Home page.
2. In the pages, search for the Content Details page:
3. On the Content Details page, locate the operations/entity operations, in the Header Zone (Right). By default, it can be disabled so enable it by system settings.
4. After that, it will be enabled, and click on the Operation/Entity Operations it navigates to the entity operation component.
5. We will add a new operation, click on the Add operation button on the top left and find the custom External Action.
6. Name it as per your requirement, I am naming it AI Tagging, to change the icon click on the plus sign icon, and add action from the action option. I am adding my custom action “CMP – AI Tagging – Action” in which I have written a custom script for my business logic.
By clicking on the Plus sign, you can add more than one action and some other operation settings you can explore as per your requirement. Click on save to save your changes in the new operation.
To know more about how to create a custom script, action, and trigger, see the blog post:
Also, can go through another blog in which I explained trigger an action using Postman, see the blog post: Create Script, Action, and Trigger in Sitecore Content Hub
7. To check the custom action button, navigate to any Content entity page and click on the custom action button "AI Tagging":
8. We can see logs in our scripts whether it's successful or not.
Happy Sitecoreing 😊
Comments
Post a Comment