Combining multiple properties in render

I have a similar request to this post (from 2017 with Omeka Classic).

Combine several item type metadata

My hope is that there is a nicer way to do this in Omeka S, perhaps with view helpers? The closest seems to be the dataType helper, but I would ideally be able to single out an individual property using a built-in helper View Helpers - Omeka S Developer Documentation.

My use-case:

I have a property for width and a property for height using the integer data type. I would like to combine these in the rendered output as a single ‘Dimensions: height x width’.

I can of course override the show.php in the theme to achieve this, but I sense there is a better way. Pseudocode:

  • check the presence of values in width and height
  • create new renderable object with the label dimensions and the value width x height
  • remove the renderable objects for independent width and height so they don’t get rendered too.

I’ve had a trawl through the developer documentation and it’s not obvious though my hunch is that I could create a simple module or theme helper to do this. Any pointers/examples would be gratefully received please.