Copied to clipboard

Flag this post as spam?

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

  • Otto 8 posts 73 karma points
    Jul 21, 2016 @ 14:31

    Retrieving images used in RTE / on page for Google Images Sitemap


    I'm looking into creating an images sitemap for Google:

    Google needs a reference/context for the images which is a page url. In my case I have images added on a page through the RTE (with a macro, not the default add media button).

    Any idea how I could efficiently retrieve images used in the RTE / macro's on a page?


  • Marc Goodson 1283 posts 8694 karma points MVP 5x c-trib
    Jul 22, 2016 @ 22:14
    Marc Goodson

    Hi Otto

    A little bit tricky to query all your content and parse with regexes to find inserted macros and read any media links.

    I'm wondering if the way to do this is to create a RelationType called MediaOnPages between a content document and a Media item, and then to handle the publish event, and look for any macro's with media item's inserted within the rich text content, and then, if any are found, use the relations service to create a relation under the 'MediaOnPages' relation type between the page and the media item.

    You could then build your google image map, by looping through the relations under the 'MediaOnPages' relation type.

    There was a package a while back that tracked when media items were used within the rich text area using a similar technique, I can't remember it's name. EDIT: I can here it is:



  • Otto 8 posts 73 karma points
    Jul 23, 2016 @ 12:25

    Hey Marc,

    Thank you! I will look into that package, looks like it provides what I'm needing :)


Please Sign in or register to post replies

Write your reply to: