Media assets: Add an 'in use' filter that only applies to records, excluding block previews (edited title)

In our media area we have image uploads to use as preview images for blocks, as well as images that are being used inside our content models by the client. In order to get an overview of all the images that are being used in the content, we wanted to set up a filter by leveraging the ‘in use (true)’ filter in both GraphQL and the media area.

But it seems that this filter is returning images that are also being used as preview images for certain blocks - because when clicking on the image details in the media area and inspecting ‘records using this asset’ is seems that it is in fact empty. The only exception that I would still expect to be included (without being tied to a record) would be the SEO fallback social card image.

So the expected behaviour would be that the filter ‘in use: true’ would only show media that are being used by an asset? And if necessary perhaps a distinction between the usage of URL (referenced via url in a text field, url in the helper text of a block (as preview image)…) / selected media would be helpful - to see if it’s either being used via URL or linked through the media selector?

Hey @gwen,

Thanks for the report!

This is an interesting situation because I can totally see where you’re coming from. But on the other hand, if we excluded that from inUse, someone could accidentally delete it (thinking it wasn’t used anywhere), and then the block previews would break.

What about using some other metadata (like a manual tag or notes) to explicitly mark the images you care about? Or, in the media area UI, the sidebar has a “Records using this asset” section at the bottom that will show you which records are using it. You can also get that data using the CMA: Referenced records — Upload — Content Management API

What do you think?

At the very least, though, I agree that this could be clearer in the UI, at least in the sidebar, or maybe the filter could be overhauled to differnetiate between where the image is used. Either would probably have to be a feature request, though. If the above workarounds aren’t enough, I’d be happy to convert this into a feature request for you?

1 Like

Hi Roger

Thanks for clarifying and I agree, usually we do use manual tags to mark the images we ourselves uploaded during the CMS preparation (placeholder content and/or preview images), in this use case a client decided to stick with the placeholder content (that was marked with a tag) so the 'inUse AND exclude manual tag 'placeholder' would’ve resulted in a false negative for this particular image so this set-up is not that robust (although in 90% of the cases it definitely could do the trick :)).

I like the proposal of either differentiating between where the image is used (for me personally the side bar UI is relatively clear - although perhaps if no record is using it you could already show a count in the tab title this instead of needing to ‘open’ the tab in order to see this). But I think persoanlly I would prefer being able to ‘extend’ the filter with a ‘usedByRecords’ option (so I guess inUse options could be true, false, onlyInRecords.

Thank you for your assistance

Thanks for explaining, @gwen! I’ve converted this to a feature request and edited the title slightly for clarity.

Let’s keep this request up and hope it gets traction :slight_smile: Thank you!

1 Like