Image credit Ahmed Musallam
Which of course leaves our authors wondering…
Naturally, we have the option to just deal with the usability challenge and address it with author training, but what if you wanted to extensively use workflows? Making authors use a hard to find feature is going to impinge adoption so how can you improve the user experience without extensively customizing the AEM UI?
You’ll notice that the AEM UI components show up under the path /mnt/overlay[path], which means they are actually generated by Sling Resource Merger. This Apache Sling feature generates a merged set of resources based on multiple source paths, in the example of the AEM Assets UI, combining the paths:
As with most AEM / Sling functionality, Resources under /apps will take precedence over resources under /libs, thus enabling a clean way to override the default AEM UI without making any modifications of /libs.
NOTE: Any modification / override will need to be maintained, so keep in mind that during an upgrade the node structure, resource types or attributes may change so keep that in mind when deciding whether or not to overlay a default feature.
To push the workflow button up in the selections action list, you can copy:
/libs/dam/gui/content/assets/jcr:content/actions/selection/create/items/createworkflow to
/apps/dam/gui/content/assets/jcr:content/actions/selection/startworkflow and then update the sling:resourceType AND variant attributes to display as a regular action instead of a sub-action.
By default the new workflow action will be put at the end of the action bar, so let’s have Sling Resource Merger insert the action between before some of the other actions. For example to place the Workflow button before the Extract Archive button, add the attribute: sling:orderBefore=“extractarchive”. When you refresh the Assets UI, you can now see that the button is now directly following the create button:
Since we don’t want the same action to be available in multiple places, we can hide the original button by adding a node at:
/apps/dam/gui/content/assets/jcr:content/actions/selection/create/items/createworkflow
with the property sling:hideResource=true
Additionally, to prevent the create button from shifting to the last position, we need to set sling:orderBefore=“startworkflow” on the node:
/apps/dam/gui/content/assets/jcr:content/actions/selection/create
I’ve created a ready to go package if you wanted to try the tweak yourself. As noted above, you will need to check across AEM versions. I’ve tested it on 6.4 and 6.5, but even between those versions the icon for workflow has changed.
I hope this helps you understand how you can use Sling Resource Merger to tweak the AEM UI as well as having some ideas of what impact this can have on your upgrade process.