Copied to clipboard

Flag this post as spam?

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


  • Paul Bennett 30 posts 53 karma points
    May 23, 2011 @ 17:52
    Paul Bennett
    0

    List where an image in the media section is used in content

    Is there a way to see where an image in the media section has been used in the main site / content?

    A client wants to be able to view and image and see which pages it has been used on

    Thanks in advance...

  • Bo Damgaard Mortensen 719 posts 1207 karma points
    May 23, 2011 @ 18:17
    Bo Damgaard Mortensen
    0

    Hi Paul,

    Good question there! I think the question itself is: which datatype holds the picture? If it's from a Media Picker datatype it should be easy to check if the datatype holds an image.

    However, if the image is present in the RTE datatype, I think you will need some sort of parsing/search in the bodyText (or whatever the datatype is called) field to look for "/media/x.ext" :-)

    All the best,

    Bo

  • Bo Damgaard Mortensen 719 posts 1207 karma points
    May 23, 2011 @ 18:42
    Bo Damgaard Mortensen
    0

    Also, if the workflow is the following: "When a user clicks an image in the Media section, it displays a list of documents where the clicked image is present" you should definately look into writing your own datatype to do the parsing and/or Media Picker check.

    Another option would be to hook into the Document published event and create a relation, using the Relationship API, between the document and the image (if theres one selected) This way you only need to look at one document/nodes (the one being published) bodyText if there's any images present instead of iterating through all documents. You're then able to get all Media-to-Document relations for a given image which gives you a list of nodeIds of the related documents.

    Hope the above makes sence. If not, let me know and I'll try to elaborate on it :-)

    / Bo

  • Richard Soeteman 4054 posts 12927 karma points MVP 2x
    May 23, 2011 @ 22:11
    Richard Soeteman
    0

    Hi,

    Might be worth to check the media link checker package

    Cheers,

    Richard

  • Bo Damgaard Mortensen 719 posts 1207 karma points
    May 23, 2011 @ 22:45
    Bo Damgaard Mortensen
    0

    That right there will be your solution ;)

    Thanks for pointing that one out, Richard! Will def. use that package whenever needed.

  • Paul Bennett 30 posts 53 karma points
    May 24, 2011 @ 13:03
    Paul Bennett
    0

    Hi Richard - that package did the trick!

    Cheers!

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies