In the previous post, we have set up an index with computed field allowing us to query Sitecore items by referenced assetId. We can now use this to build a nice widget on Contenthub’s asset details page:
Let’s start with ContentHub. Go To Manage > Pages and search for the “Asset Details” page. Add a new external component to one of the columns:
Add the following to the Template tab:
And this to the Code Tab:
You should now see a “Show usage” button on the asset details page.
The API controller
To make the button work, we’ll need to implement an API controller on the Sitecore Management instance.
We also need two settings in config:
The controller can be called as follows:
Assuming you already have an api route set up and controllers registered with DI. Read for details here and here if not.
Using an API controller on your management instance in conjuction with a widget on the asset details page, you can display detailed usage of an asset to content authors.