Steve Temple
Technical Director of Gibe Developer, Umbraco MVP/Certified Master/Unicore Team e-commerce expert, AI tinkerer
In CodeGarden 2019 Jeffrey Shoemaker did a talk about his dreams for Umbraco
He talked about his dream of a better media section
A lot of what he said aligned with thoughts I'd be having with media
Would it now be possible to make these dreams come true
Let's take a look...
Makes sense for content, but for media it requires a level of organisation which isn't intuitive
Every site I've used has ended up with hundreds of images in the root
No drag and drop
Is this the optimum way to find the media you are after?
Searches just images in the current folder, even when in root
Would be nice to have an option to search all media, or all child folders
Very limited data we can search on, just the name
Doesn't look too intimidating when you have 3 items, but when you have 300 it's not really usable
Doesn't show thumbnails for images
Is this the most friendly way to sort items?
Let's take a look...
Most editors will click the upload and upload their media
This uploads their media into the root of the media section
Does every image even need to be in the media library?
No visual clues about their content
Look a bit weird with just the icon
I rate it 3.6
Not great
Not terrible
Content exists in the structure of the site
Content has a lot of textual and meta information
Media is attached to an image, file, or other external source
Media has very little content, or meta information
What would the dream media section and picker look like?
What are editors trying to do when using a media picker?
Some images we'll want to reuse, but often this image is something we'll just want for this single piece of content and that is it.
In that case does it need to live in the media library?
Media tree shows when you check to save media to media library
Select whether you are uploading or using an existing item
This is very much based on the current UI.
But let's make it a bit more information rich
Selecting an existing item from the media library...
This is pretty much the current UI however could we make that media easier to find
Add meta data
Give some extra insight into the contents of folders
What are editors trying to do when using the media section?
Give some extra insight into the contents of folders
Filtering and faceting
Add a way of finding media by where it's used
When I talked about this in 2019 it wasn't really possible to do this. In my talk about media AI, I ended up hiding the existing media section and making my own. I created a new data type with it's own picker to replace the standard media picker.
Now Umbraco since v14 has extensions points that will let your replace core sections of the Backoffice UI
I'm new to v14+, Typescript, Lit etc.
I'm going to try and show you how I went about figuring how to do this, what worked, which resources are useful and where the problems lie.
I wanted this to be a demonstration of learning how to do this, hopefully this will smooth the learning curve for others
I had planned to spend 5 full days to learn what I needed to do and get as far along as I could.
Whatever I managed to build at the end of those days is what I'm going to show today.
Read the getting started docs, Umbraco and Lit
Setup dev environment, using VS Code
I always had at least 4 tabs open at each step:
The first thing I did was create an empty modal.
Keeping it simple, I just want to prove that we can replace the media picker modal.
The only UI it would have was some tabs as they were one of the key differences between the existing modal and mine.
How do tabs even work?
I could find them in the UI documentation
Coming from an Angular background, this didn't work as expected. I was expecting passing in models, binding etc
The UI is very bare bones with focus on L&F rather than function
There are differences between the 2 UI documentation sites
https://apidocs.umbraco.com/v15/ui
vs
https://uui.umbraco.com/
(UUI is latest, apidocs lets you pick specific versions of Umbraco)
I ended up looking at the source code for existing UI to figure this out
Try and replace the existing modal
Looking at documentation, we should be able to overwrite existing elements in the manifest.
https://forum.umbraco.com/t/extending-existing-umbraco-backoffice-components/2582/2
However a member of the community has been here before me and they've shared their solution
For some system wide modals, you'll have to unregister the existing one and then add your own
Thanks Richard Ockerby for sharing your solution
Now we've proven we can replace the existing modal, can we extend, or pull code out of the Umbraco version.
Wasn't able to extend the class, so I started copying code in
This doesn't work as expected, some keys things in the @umbraco-cms/backoffice package are not exposed, or cause issues.
I ended up copying the MediaTreeRepository and all it's dependents into my package, this is not ideal.
I also notice that while contexts in the constructor compile, but have errors in the console when running Umbraco. For now I commented them out. fairly certain they're probably doing something import!
Now I wanted to try and refine the UI.
First off I wanted to try and display a media tree with just folders to allow you to pick where you were saving your media.
The current media tree doesn't support that, but perhaps it does in the API.
There was a promising looking parameter: dataTypeId
But it did not do what I expected
The current delivery API is just doing exactly what the Backoffice needs and no more, which is understandable. But wouldn't it be nice to have options to extend, filter, override or build on top of what is there.
I started to write my own API but thought I'd come back to this.
My plan to show previews was to develop my own custom Lit element.
This element would be used when the media item had children (essentially it was a folder). I wanted it to lazy load so it makes a request once the top level stuff had loaded in.
I used the current umb-imaging-thumbnail component as an example.
This I modifed to load in the children, and then render each child as a thumbnail.
The downside of this is it making 1 additional requests (+1 extra for each image) for each media item that has children. But I'd rather do that then wait for it all to build up before rendering
Got absolutely stuck trying to get MediaService to work, query parameters were not being set over no matter what I did.
I tried copying the media repository, I tried loading it via UmbExtensionManifestInitializer, I tried pulling out my hair
In desperation I upgraded Umbraco to v16 (which had just been released). Suddenly it all starts working
Yes it can be done, but in the current state of things, it might take longer than you expect.
Maybe getting a proof of concept running in a week was ambitious.
You'll also have to be willing to make compromises, duplicate code and spend some time being frustrated.
Mostly one of frustration, but some highs along with the lows.
I'm actually pretty pleased with what I have, but expected to be much further along.
I'm sure some of this is down to my lack of experience with the tech stack being used, however I'm an experienced dev, with contacts and intimate knowledge of Umbraco, would be much harder for a less experienced, less connected developer.
What can we do?
Umbraco's focus has been on getting feature parity with v13 in the new UI.
We need to get the developer experience for the Umbraco Backoffice into a better place. Please try stuff, and when struggling, ask questions, write blog posts, share examples, raise issues, create PRs and write documentation
However that means they've been creating (technical) debt like an Icelandic bank during a sub-prime mortgage crisis
Here is a list of the issues I've raised as a result of this talk so far, there are a few more coming...
https://github.com/umbraco/Umbraco-CMS/issues/19560
https://github.com/umbraco/Umbraco-CMS/issues/19561
https://github.com/umbraco/Umbraco-CMS/issues/19565
It's 2025, is it even legal to have a tech talk without AI?
Simplest form would be just to find items with the same size and filename
Use Azure Vision API to generate a vector for each image which plots each image into a 3D space
We can then do a spatial search and find nearby media items, in theory we can then find different crops of the same image or very similar images
Use the Azure Vision API to suggest tags, alt, video transcriptions etc
Is this the right place for alt tags? Perhaps it should be possible to override alt tags in the media picker. More contextual
AI will be great at backfilling this data if the package is added later on, and now you want to populate 3000 media items with data
I would love to get some of these ideas into Umbraco, either as a package or some bits into core.
Would you like to help?
Speak to me, or get in touch after Codegarden!
By Steve Temple
Technical Director of Gibe Developer, Umbraco MVP/Certified Master/Unicore Team e-commerce expert, AI tinkerer