Sitecore has several templates it uses for items uploaded into the Media Library that can all be found at /sitecore/templates/System/Media. There are templates for all media types--documents, images, files, and more.

As part of a custom integration project for a client, I needed to add some custom fields on to items added into the Media Library from a third party system. I didn't want these fields present on items uploaded through the Media Library, so I chose to make new templates that inherit from these built-in media templates with the additional fields tacked on.

After I created these templates and imported some items with them, I was surprised to find that they would not show up in the Media Library Browser. In this post I'll outline how to fix that.

Copy Custom Media Templates to Core Database

If you switch over to the core database and navigate to /sitecore/templates/System/Media, you'll find that exact copies of all of the templates in the same location of the master database exist here too.

You need to copy your custom media item templates over to the core database as well. Open the Sitecore Control Panel, and click Move an item to another database in the Database section. Follow the wizard to copy your templates over to the core database. I recommend placing them in the same folder structure that you have in your master database to make them easier to find in the future, but it doesn't really matter. Note that this wizard actually copies your items over, it doesn't delete them from the master database as the name implies.

It's important that you copy your templates to the core database exactly as they are in the master database, down to the same ID.

If your custom media item templates derive from one of the built-in media item templates found under /sitecore/templates/System/Media, your items should start to show up in the Media Library Browser.

If your custom media item templates do not derive from one of the built-in media item templates found under /sitecore/templates/System/Media, this is only part of the story. Keep reading.

Why Duplicate the Templates?

It may seem strange for these templates to be duplicated, but the presence of these templates in the core database drive what types of items are displayed in the Media Library Browser. If you inspect network traffic when you do a search in the Media Library Browser, you'll see a request made to the following URL:


The key is the searchConfig parameter in the query string. If you lookup the item {B0DF45DF-EA31-4C11-9E34-98B41DF549C5} in the core database, you'll find an item called AllMediaFiles located under /sitecore/client/Applications/Dialogs/SelectMediaDialog/PageSettings/SearchConfigs. The Media Library Browser uses this item to filter its search to only items found under sitecore/media library (see the Root field) and only items that inherit from the /system/templates/media/unversioned/file or /system/templates/media/versioned/file templates (see the Base Templates field), which all templates under /system/templates/media inherit from.

This search config item only knows about items in the core database, which is why all of the media item templates must be duplicated to core as well.

If your custom media item templates don't derive from one of the built-in file templates, you have to add them to the Base Templates field of the AllMediaFiles item. Now they will show up in the Media Library Browser.

Has this helped you out? Let me know in the comments. Cheers!

This post originally appeared on the Perficient Microsoft blog.