Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • David Amri 214 posts 740 karma points
    Sep 16, 2021 @ 11:30
    David Amri
    0

    Check if media item is used in content

    Hi,

    Is there a way of determening if a media item (in this case a pdf) is used by any media picker in the content?

    I'm searching and presenting the content of pdf's but the indexer is using "IndexParentId" which means that it will index all of the pdf's of that parent node, in this case a folder.

    Now the problem is that the user are able to attach pdf's in the content with the media picker. If the user then later decides to remove a particular attached pdf from one of the content nodes the pdf is still indexed but not really relevant for the search result. In order for the pdf not to be indexed the user then have to delete the file in order to not show up in the search result.

    Is there a way of detecting if a media item is used by any content node?

  • Erik Eelman 81 posts 321 karma points
    Sep 21, 2021 @ 12:10
    Erik Eelman
    0

    Hi David,

    There is a package available for this called Nexu: https://our.umbraco.com/packages/backoffice-extensions/nexu/

    If you need to detect it yourself in code, you can look in the sourcecode how its done:

    https://github.com/dawoe/umbraco-nexu

Please Sign in or register to post replies

Write your reply to:

Draft