Hi Damian,
You may want to refine this locally, but one of our developers has provided an updated snippet that should serve as a good starting point.
The following will take the first alternative identifier value with a label of "external_id" and append it to a link in the context menu, in a similar way as shown in the screenshot included in my last post. If you need it to pick a specific alt-ID when there are multiple using the "external_id" label, or else fail instead, you'll have to do further testing and code changes yourself. Other alternative identifiers with different labels will be ignored.
Similarly, this code does not factor in multilingual functionality - currently the label and link that will appear in the context menu are hardcoded in this snippet. Adjust as necessary.
If no alternative identifier matching the label criteria is present, then the context menu link will not display.
Try adding the following to the same file linked in the last post:
<?php
$externalId = $resource->getPropertyByName(
'external_id',
['scope' => 'alternativeIdentifiers']
)->getValue(['cultureFallback' => true]);
?>
<?php if ($externalId) { ?>