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?
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.
Retrieving images used in RTE / on page for Google Images Sitemap
Hey,
I'm looking into creating an images sitemap for Google: https://support.google.com/webmasters/answer/178636?hl=en
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?
Thanks!
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: https://our.umbraco.org/projects/backoffice-extensions/media-content-usage/
regards
Marc
Hey Marc,
Thank you! I will look into that package, looks like it provides what I'm needing :)
Otto
is working on a reply...