This was brought up by netaustin at #448000-9: Big, Over-Arching Sitemap Architecture Discussion (tm):

"# Google News provides a namespace to extend the Sitemaps.org XML file for their purposes. Can we address this?"

I looked more into this and according to http://www.google.com/support/webmasters/bin/answer.py?answer=34654&topi..., there are actually four "sitemap extensions" that Google supports:

The news one in particular would be useful to a lot of Drupal sites out there.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Dave Reid’s picture

Assigned: Unassigned » Dave Reid
Status: Active » Postponed

As I told webchick in #drupal, I actually do have a basic xmlsitemap_news module coded for creating Google News sitemaps. Just a matter of cleaning it up and integrating it with the current xmlsitemap code base. For now though, I'm marking as postponed to focus on the major issues (the base xmlsitemap modules).

apaderno’s picture

I would put the code for generating different type of site maps in a module that can be enabled when needed.

webchick’s picture

Oh, yes. Definitely an optional sub-module. It'd only be necessary for sites that specialize in this sort of content.

apaderno’s picture

I guess that the site map URL for those site maps would be different from the one actually used, and the project would handle more than one site map.

gregarios’s picture

Subscribing.
I'd love to see the additional functionality of being able to have a Google News sitemap (http://www.google.com/support/news_pub/bin/topic.py?topic=11666) in addition to the normal web sitemap.

eyecon-1’s picture

Integrating Google News is a big plus for me. BTW, absent from the current GN module are keywords which has been a simple hack:

$content .= '<news:keywords>key words ...</news:keywords>';

Of course, this approach assigns the same key words to each item. The better approach is probably to tie it into a vocabulary.

As an aside, people should realize that having a Google News sitemap does not mean inclusion in Google News. We had to jump through hoops. The site was once (incorrectly) suspended and it took six weeks to get back in. It does create a great deal of traffic.

Dave Reid’s picture

I was thinking that it would be nice for the XML sitemap news module to automatically install a taxonomy vocabulary based on http://www.google.com/support/webmasters/bin/answer.py?answer=42993 but also allow the user to select which vocabularies are included.

gregarios’s picture

Oh man that would be cool. :-) Our site is currently accepted into Google news, but I don't have a sitemap for them anymore since we moved our site to Drupal. Anxiously awaiting the update to XML site map that will incorporate even a minimal news sitemap. We need the traffic it generates.

Dave Reid’s picture

If you need news sitemap support now, you can use the Google News sitemap module which I took over and willl be integrating back into XML sitemap in this issue.

gregarios’s picture

Will it migrate nicely after you integrate it into XML Sitemap? No database incompatibilities now or then?

Dave Reid’s picture

I don't anticipate there being any problems on the migration. There's only one setting in the current module and I don't plan on making it any more complex before migrating it over.

gregarios’s picture

Great! Thanks. :-)

rickvug’s picture

.

eyecon-1’s picture

I think that you should leave these separate. I run my news sitemap every half hour. Due to overhead, I could not do that if the two are combined. Actually, I am using Elysia Cron. If the two had separate cron hooks - no problem.

Anonymous’s picture

If the two had separate cron hooks - no problem.

Phased cron runs would be an excellent feature for Drupal-8. I'll open a feature request if there isn't one already.

Dave Reid’s picture

@eyecon: They'd remain two separate modules, so that's not a concern.

CinemaSaville’s picture

My site primarily consists of my videos/movies, so it would be great if we could support video sitemaps as well. If you'd like to take a look- http://CinemaSaville.com

Thanks.

Ingumsky’s picture

Oh... Subscribing.

FiNeX’s picture

subscribing

kwhatcher’s picture

This would be great for our site! Has there been any recent developments?

-Kerry

http://www.41nbc.com

Dave Reid’s picture

Priority has been finishing the main module and its APIs. Probably after we get our official 2.0 release out I can focus on the views integration for accomplishing this.

nicholas.alipaz’s picture

just subscribing, I am very interested in the video sitemap. I will write my own module to do the deed until then. It would however be much nicer if it were a submodule of xml sitemap which i already use.

blavish’s picture

subscribe!

spamwelle’s picture

subscribing

arnieswap’s picture

Google rejects this site map, while it accepts normal RSS. What is the reason?

gregarios’s picture

Google rejects this site map, while it accepts normal RSS. What is the reason?

Google usually gives a reason. Can you tell us?

Dave Reid’s picture

So the tough part about this feature is how do we get the data? Do we support only certain video modules to start out with?

gregarios’s picture

So the tough part about this feature is how do we get the data? Do we support only certain video modules to start out with?

Wow... good question. There are a lot of modules that have "video capability" which aren't dedicated video modules, too. I use Lightbox2 to display videos in a lightbox, so there really wouldn't be any way for your sitemap to get that info I wouldn't think. I don't have a dedicated "video" content type either...

Maybe you should just have an added selector in the "Content Types" settings that will allow people to make any content type strictly a "video" type, or let them make the Content Type have a "Per Node" setting that will transfer the checkbox to the node/add stage. That would allow the greatest customization capability for any sitemap type you wish to add as well — video, news, image, etc. You also wouldn't have to worry about the next big video module every time one comes along. You could also designate any node to be in multiple kinds of sitemaps that way as well. :-)

(I could even possibly select each node that contains a lightbox-fed video to be in the video sitemap, etc)

apaderno’s picture

If the module would implement its own content type, then the suggested way to proceed would be to allow the user to select the content type, which by default would be the content type added by the module; as XML sitemap doesn't implement any content types, it should have an option to select which content type add in the particular sitemap.

gregarios’s picture

I think it should be rather like it is for the current sitemap settings, only now the user could select which kinds of sitemaps to "include" or "exclude" the node from as well.

Dave Reid’s picture

With all the special meta data that's optional, but most people would want in their sitemaps, I'm thinking a specialized module-integrated solution is necessary. I can't see a general solution working.

arnieswap’s picture

The error said that this site is not in our database. The site is in their Google News programme. If I submit RSS feed its validates it. But when I submit News Site Map created by the module it gives the above error. What could be the reason? Same is with normal Site Map created by the Site Map module.

apaderno’s picture

@arnieswap: XML sitemap doesn't output news sitemaps, at the moment. If you have any problems with the sitemap created by XML sitemap, then you should open a new support request (after you verified there is not already a report with the same topic).

gregarios’s picture

The error said that this site is not in our database. The site is in their Google News programme. If I submit RSS feed its validates it. But when I submit News Site Map created by the module it gives the above error. What could be the reason? Same is with normal Site Map created by the Site Map module.

What happens when you create a correct news sitemap.xml file manually and place it in the document root? Does Google accept it then? If it doesn't, then there may be something going on with your Google acct or hosting setup.

Zoltán Balogh’s picture

subscribing

sp_key’s picture

I'm also interested about a video sitemap.
Any developments?

Ingumsky’s picture

Dave, unfortunately I'm not a programmer but how can I help you with implementing this feature? Can I?

chawl’s picture

As Domain XML Sitemap is ready (and marvellous), new *maps should be domain aware also.

At least Google News sitemap module will have been assimilated for good then.

Subscribing.

blavish’s picture

subscribed

Dave Reid’s picture

Ok so awesome news is this is going to be very possible with the new concepts of XML sitemap contexts that are currently in place for domain access and/or language integration.

If you want to help move this along, I could use some reviews and testing on #764658: Use XMLWriter class instead of fwrite().

Dave Reid’s picture

Version: 6.x-2.x-dev » 7.x-2.x-dev
Dave Reid’s picture

Title: Support for extended sitemap formats (e.g. video, news) » Support for extended sitemap formats (e.g. video, news, image, mobile)

Widening concept a little bit to merge some issues into this one:
#739246: Mobile sitemap generation
#769794: Adding Images to Sitemap

locomo’s picture

subscribe

Pacosto’s picture

Is there a module for video sitemap? if not, how I can create the sitemap for videos on my website? Thanks

infojunkie’s picture

subscribe

onetrader’s picture

subscribe

FiNeX’s picture

I want to share my thougts about linking one or more images to a story node type visible in the sitemap.

You could have a situation with a story node type and the following node fields:

  • title
  • body
  • main_image
  • extra_images

According to the google specification, you can set one or more significant images of a specific page. For example you could want to add a specific imagefield (main_image) to the sitemap.

But how? An interface would be necessary to specify that the imagefield needs to be added (without forgiving the title and the caption which could be the "alt" and "title" settings of the image or the title and description if any).

IMHO the most reasonable way is to add a checkbox on the imagefield settings page in order to allow/disallow the inclusion of the imagefield on the sitemap.

What do you think about? Is this a valid idea?

liquidcms’s picture

+1.. looking at adding images to sitemap now.

i don't think the current API really supports adding fields to the xml node unless possible doing a complete new module similar to xmlsitemap_node - but just started looking at this so hopefully simpler than that.

liquidcms’s picture

This was my approach for D6 to add an image from a specific node type to the sitemap. Unless i am wrong the current API does not allow this, as the function xmlsitemap_generate_chunk() hard codes the XML nodal structure and does not allow any other module to modify this.

so my approach was the smallest hack/patch i could think of was simply to add a module_invoke_all of a new hook called xmlsitemap_modify_link in to that function to allow my module to add content to the xml node.

i then used the existing query_xmlsitemap_generate_alter hook which is within the same function to modify the sql used to query the xmlsitemap table and tack on the image data to this.

my test case is this:

- need to add field_image from node type "product" to product entries in the sitemap
- other node types also use field_image so i am joining off the content_field table not the content_type table

i have a module called cs

in the folder for that module i have a file called cs.xmlsitemap.inc (which the xmlsitemap module auto loads)

in that module i simply call the 2 hooks mentioned:

function cs_query_xmlsitemap_generate_alter(&$data, $sitemap) {
  $data['SELECT'] .= ', f.filepath, n.title, n.type ';
  $data['FROM'] .= ' LEFT JOIN {node} n ON x.id = n.nid LEFT JOIN {content_field_image} i ON i.vid = n.vid AND x.type = "node" LEFT JOIN {files} f ON f.fid =  i.field_image_fid ';
}

function cs_xmlsitemap_modify_link($link_output, $link) {
  global $base_url;
  if (!($link['type'] == 'product' && $link['filepath'])) return null;
  
  $link_output .=  
    '<image:image>
      <image:loc>' . $base_url . "/" . $link['filepath'] . '</image:loc>
      <image:title>' . $link['title'] . '</image:title>
    </image:image>';
  
  return $link_output;
}

next to no performance hit and seems to work just fine; but please let me know if there is a better way of doing this.

also, for consistency, i would think the query array structure used in xmlsitemap_generate_chunk() should likely have a 'JOIN' key.. just a thought.

mbutcher’s picture

I'd like to +1 this.

As Google and Bing add new supported elements to their sitemaps, it is becoming increasingly important that developers be able to support more flexible sitemap formats.

While the most flexible route would be to use the theming system, that may introduce a substantial performance penalty. Liquidcms's solution above gives enough flexibility to accomplish things, but with no substantial negative performance implications.

Dave Reid’s picture

cientista’s picture

I would love to have both video sitemaps and news on my site. video is particluarly important as a vide sitemap is the only way to identify it in the meta data. subscribing

Rhino’s picture

I like the poster above want video and news, subscribing

sunward’s picture

As there is now support for video sitemaps in google, should this no longer be marked "postponed"?

Dave Reid’s picture

It's not postponed because google now supports video sitemaps. It's postponed because of the reasons outlined in #51.

Dave Reid’s picture

Fixed the two issues in #51, and now only #787578: Figure out how to handle the global 'type' context is a blocker on this issue.

memoo’s picture

subscribe

ilw’s picture

+1 for video sitemap.

blavish’s picture

+1 news!

willmoy’s picture

Sub (news)...

Leksat’s picture

subscribing

kentr’s picture

subscribe

XerraX’s picture

subscribing

yonailo’s picture

+1 for video sitemap.

lpalgarvio’s picture

subscribing

lpalgarvio’s picture

sunward’s picture

LPCA - the problem is it needs to be done by hand. I had to do a video sitemap that way. Very annoying for 4 videos.

tigron’s picture

subscribing

Lars Toomre’s picture

Thanks for all of your excellent work in developing and refining this module. Like many others, I am really grateful for all of your efforts.

I am very curious about the status of adding image information to the sitemap.xml files. At this point, the number of images on one of my sites has grown to be more than 200. I would really like to be able to automatically add these images to the sitemap.xml file(s). So my first and general question is what is the status of the xmlsitemap module adding images to the resulting sitemap.xml file(s)?

Assuming that this is still on the postponed list of features that will be added at some point, I am wondering whether it might be appropriate to add an xmlsitemap hook of the alter variety that gets called to alter (or enhance) the information that gets written to sitemap.xml file for a particular entry. If such a hook existed, myself and others could add code in other custom modules that would add image or video image information to the sitemap.xml file without having to make any changes to the still developing xmlsitemap module.

Thoughts?

mdorrell’s picture

+1 for video sitemaps. Hopefully backported to D6 :)

digi24’s picture

Could the maintainers please provide a roadmap/schedule, when to expect new sitemap formats or just an API to allow to implement this for D6?

Dave Reid’s picture

@digi24: I've already linked to the issues that I've been working on that are blocking this issue. Once those are completed, I can start working on this one. The best thing I have for a roadmap is "yes I'll be working on this and it will be put into both 7.x-2.x and 6.x-2.x, and at least the API will be available by the 2.0 official version.

vascordoba’s picture

Category: feature » support
Issue tags: +video, +Sitemaps

Hi Dave

I have tried to contact you by your contact form and also through facebook.
As I stated in former emails, I'm working at Google, specially assigned to Video Search Team, where we have the task to help everyone who has a site or tool for publishing videos to accomplish the creation of well-formed sitemaps, in this case video sitemaps.
I was wondering if you need any sort of help on the xml sitemaps module. I have little experience in Drupal but I have 5+ years of experience in PHP.
Let me know if you need some help with it
Thanks in advance

sethiele’s picture

Issue tags: +image

subscribing
I need a image XML Modul.

j0nathan’s picture

Subscribing (Google News).

kentr’s picture

@J0nathan:

There's another module for Google News.

j0nathan’s picture

Hi kentr,
From the project page of the module "googlenews", it says:

This module will soon be integrated into the XML sitemap module. Stay tuned to #451234: Support for extended sitemap formats (e.g. video, news, image, mobile) for the integration progress.

This is why I subscribed here.

miaoulafrite’s picture

+1 for video sitemap

ppcc’s picture

subscribing

gstout’s picture

Status: Postponed » Active

I'm trying to get a bead on the development of this module and the original Google News Map. Should I use the original module for now or is this addition nearing completion. I have installed the dev version to see your progress but it did not build a function site map and I saw no inclusion of an interface to generate a google news sitemap.

Any information that would help me build a site launching at the end of the month.

HS’s picture

Issue tags: -video +video sitemaps

+1 for video sitemaps

gregarios’s picture

Should I use the original module for now or is this addition nearing completion.

I've been using Google News Sitemap 6.x-1.4 and XML Sitemap 6.x-2.0-beta1 together for about a year now with no problems. Should be easy enough to uninstall the Google News Sitemap and upgrade XML Sitemap when the functionality becomes available.

RobertCox’s picture

Subscribed.

Terko’s picture

Subscribe. Video sitemap is something important, as GN too.

mennonot’s picture

Subscribing for information on Google News Sitemap integration

neutron2000’s picture

+1 for video sitemaps

Beanjammin’s picture

As with #82, it would be great to see the code mentioned in #1 in -dev, regardless of its current state, so that those of us who are motivated to get the extended sitemap functionality going can help out.

blavish’s picture

I upgraded to 7. This was the one module i forgot to check. Oh noes
Any news on the Google News sitemap module integration for 7?

momper’s picture

sub

vasrush’s picture

sub

Lionsharz’s picture

Hi - very keen to use this module. Any help in terms of testing? I'm fairly experienced Drupaler but not a programmer - would be available if you I could be of any use to you. How is the module progressing and is there any type of time frame on it?

vascordoba’s picture

I have created a video sitemap generator module that has pending review.
I think it could be integrated with this one too in the future

apaderno’s picture

Category: support » feature
Status: Active » Postponed
willmoy’s picture

#1040798: D7 Patch for googlenews now has a patch to allow the old (deprecated) googlenews module to be used with D7. Use at your own risk and please report your experiences back in that issue.

Jeffalo’s picture

subscribing

chris_getdepth’s picture

subscribing

Jason Jaeger Geoprobe’s picture

subscribing

elsvandeveire’s picture

Hi Vascordoba, any news on your video sitemap generator module? Would be great to start using this. Thanks! Cheers, Els

sugarbase’s picture

subscribing

erikwagner’s picture

Hey Guys, A co-worker just found this Drupal Module for Video Sitemaps:

http://code.google.com/p/video-sitemap-drupal/downloads/detail?name=vide...

Has anyone used it before? Would someone take a look at it?

elsvandeveire’s picture

Hi erikwagner, I've downloaded this but it's way to complex for me to start. E.g. I've created a content type, called portfolio, and each portfolio node has a video. But it's not clear to me if I can use this content type with al its fields (text + video). I need more explanation to use it. I hope Vascordoba (the developer) gets in touch!

Ela’s picture

subscribing

B-Prod’s picture

Here is a patch for D6-2.x version, for image support within imagefield only.

This patch does not provide a correct and reliable way to handle images (as said above, contexts should be used and database tables should be modified, which represents a heavy work).

This patch may only help those who need a workaround for images support, awaiting a real and correct implementation of this feature.

spgd01’s picture

Subscribe

CristianCantoro’s picture

Subscribing

Dave Reid’s picture

Anyone reading this is more than capable of seeing that #787578: Figure out how to handle the global 'type' context is still a blocker for this issue. That's where this needs help.

oboz’s picture

Issue tags: +Google image sitemap
FileSize
2.87 KB

I created little module for generate Google Image sitemaps in Drupal 7.
This module based on Google News sitemap module by Webopius Ltd.

Maybe this module can come in handy to someone, as long as this type of sitemap is not made ​​in xmlsitemap.

vkr11’s picture

subscribe

TimG1’s picture

subscribing

tsvenson’s picture

subscribing, great to see this is being worked on.

BenK’s picture

Subscribing

Balbo’s picture

+1

lord_of_freaks’s picture

+1

bessone’s picture

+1

leovw’s picture

+1

Oscar Illada’s picture

i need it for drupal 6, we want to do a video sitemap like this example http://www.google.com/support/webmasters/bin/answer.py?hl=en&answer=80472 thanks!!!!

rwohleb’s picture

subscribe

lemming’s picture

This is the beginning of a set of modules and modifications to the XML Sitemap module that I have started to writing in order to provide the video sitemap protocol extension. My example is incomplete, but works for media_youtube video fields and some locally hosted video items.

The xmlsitemap_video module attempts to show how it might be possible to add extension modules to add and include additional xml data into the sitemap. The thoughts here is that it would be the responsibility of the extending module to determine what additional information gets included into the sitemap based on a loaded xmlsitemap link. XML sitemap is only responsible for calling the right extensions based on link type (node, menu, etc...).

I have included a patch file that makes slight modifications to the xmlsitemap.xmlsitemap.inc and xmlsitemap.generate.inc files, though a lot of what should be added has been for the time being living within the xmlsitemap_video module. This would include the HOOK_xmlsitemap_extension_info() and XML sitemap element classes and interface (found in includes/xmlsitemap_elements.inc in the xmlsitemap_video module).

The video_props (video properties) module attempts to retrieve and capture the necessary data for the video information. This module is currently unfinished, but does properly support embedded youtube video provided by the media_youtube module and fakes a bit of support for locally hosted files. This is probably less important to the sitemap specifically as this data could potentially be provided in other ways, but it was part of my working example.

I confess that I am fairly new to both the XML Sitemap code and the sitemap protocols. Hopefully am helping progress the project toward a real solution to the current problem of adding sitemap extensions. I would be happy to keep tinkering in this area, or expand on any ideas developed here.

lemming’s picture

Opps attached the wrong patch file above. My apologies for the mistake. It seems like I am unable to edit files attached to my comments?

Oscar Illada’s picture

do you have a drupal 6 version??

lemming’s picture

The point was merely to demonstrate an idea for providing sitemap extensions. The intention is to share some ideas that hopefully could get this issue moving. Anyone interested in how this extension works, the highlights would be in the xmlsitemap_video module, specifically the HOOK_xmlsitemap_extension_info() and the include/xmlsitemap_elements.inc file.

I do not recommend anyone use the code or patch that I put here for production purposes. It's merely a partially working example. Once the xmlsitemap maintainers and community agree on a solution (whatever it might be), I would be happy to create an actual module (if someone doesn't beat me to it). I do plan on doing a significant refactoring of the code posted here (and know of some bugs already), but that won't come until I know the official API to build from.

Störtebeker’s picture

Has anybody successfully used this module from google for video sitemap?

http://code.google.com/p/video-sitemap-drupal/

_________________

I followed the installation steps but get the following error message in Drupal (6.22):

The import data is not valid import text.

This happened after the following described steps (regardless if the video content type existed or not (tried both):

"...
3) In the Administer / Content management / Content types => Import menu option, select Create from the selection box (or select Video(video) if you do have a Video content type already).

Then, copy the contents of the video_content_type.txt file (located in the installation folder), and paste it in the Import data field. After that, hit in the Import button below the field.
..."

I successfully exported my previously made video content type, deleted it, creeated a new video content type with pasting your text file as Import resulting in the above error message

"The import data is not valid import text." and no new content type "video" has been imported.

Importing my previously made video content type succeeded. So there is no HTML Editor interference (no WYSIWYG Editor for the import form field). I used Netbeans IDE, Editor, Wordpad for copy & paste the plain text file, no success.

All of my dependency modules are newer than the ones mentioned in your list (CCK: 6.x-2.9; Video: 6.x-4.2; FileField: 6.x-3.10)

______________

It looks pretty promising but I cannot get it run :-(

Looking at the posts there I have seen that Dave has alreaddy tried to get in contact w/ the google coders of this module but it looks he never got a reaction from there.

Sounded like a good idea to bring the 2 streams together.

Thx for all the contributors here.

Stort

bensnyder’s picture

sub

AgaPe’s picture

sub for google news integration

deepesh’s picture

Sub for extensions for images, news and video.

anavarre’s picture

Subscribe

allandk’s picture

Subscribe

Terko’s picture

Yes, it's nice module and works, but with unaliased urls.

Terko’s picture

I successfully used the module. Just be sure to import the right code. Don't import commendts in the beginning, copy the import file from the first command to the last command without spaces or empty lines in the beginning and in the end.
The problem with this module is that it disables the auto thumnail feature of Video module, so I enable it, make sitemap and when I need to upload new video, I need to disable the module and then after uploading to enable it again.
I try to modify this module to catch information from Embedded Field, it looks easy task, but I am stuck on the db_query code...

maksim24’s picture

Sub for extensions for images. drupal 6.x

bensnyder’s picture

Temporary, valid solution. See this example.

Modules needed:
Views
Views PHP
Views Datasource

  • Create a view with a page display.
  • Set the path to whatever... I chose /data/photos.xml
  • No pager.
  • Format: XML data document
  • Settings
  • Fields
    • Content: Path
      • Label: loc
      • Rewrite results: Use absolute link
    • Content: Photo
      • Exclude from display
      • FORMATTER: Image
      • IMAGE STYLE: Original
      • LINK IMAGE TO: File
    • Global: PHP
      • Label: image:image
      • OUTPUT CODE:
        <?php
          $loc  = $data->field_field_photo[0]['rendered']['#path']['path'];
          $tit  = $data->_field_data['nid']['entity']->title;
        
          print "<image:loc>" . $loc . "</image:loc>";
          print "<image:title>" . $tit . "</image:title>";
        ?>
        

YOU WILL NEED TO CHANGE THE NAME OF YOUR FIELD IF IT ISN'T field_field_photo. Use Devel module if you need.

Grab a beer. Stay thirsty, my friends.

tfo’s picture

+1

soroori’s picture

thank you bensnyder
when i add label video:video for create video sitemap .

This page contains the following errors:

error on line 6 at column 17: Namespace prefix video on video is not defined
Below is a rendering of the page up to the first error.

Anonymous’s picture

<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
        xmlns:video="http://www.google.com/schemas/sitemap-video/1.1"> 
error on line 6 at column 17: Namespace prefix video on video is not defined
Below is a rendering of the page up to the first error.

Probably because you didn't declare the extended namespace.

The link Webchick gave in the body of this thread doesn't exist any longer. It is now http://support.google.com/webmasters/bin/answer.py?hl=en&answer=80472

The other question that needs answered is will the other search engines deal with Google's extension to the sitemap?

gMaximus’s picture

Hi one and all ....

I thought the followers of this, may be interested in my post.... It expands on comment 133 (many thanks bensnyder) in this post but works around needing to write php ... (embarrassingly, I've still not written a line...)

How to create a Video/ Image sitemap for Google?

:)

Bye for now,

Guy

gMaximus’s picture

Hi again...

I took the trouble of detailing the process I've come up with, to make a video sitemap for my Drupal 6 sites. I've included a screen demo too. It doesn't require writing PHP for every site map. It does require adding some modules and a patch though...

http://onlinebusinessbuilders.co.uk/video-tutorials/how-create-google-vi...

Hope others find it useful :)

Guy

Anonymous’s picture

@guyd: If the patch is against this module please upload it here for review.

gMaximus’s picture

@earnie: The patch is against Views datasource.... You can see it here http://drupal.org/node/903528

My method doesn't use this module. It does allow point and click creation of a video sitemap via Views :)

I just wanted to share how I've achieved the end result for the time being...

Bye for now,
Guy

lemming’s picture

I have made a patch to the xmlsitemap module to allow custom XML Element Extensions. The idea is that these extensions are capable of adding the additional information for images or video into a link entry.

The patch, coupled with the additional module posted here (not an official module at this time) was able to produce the example output below (copied from the sitemap, with specific information hidden).

<url><loc>http://example.com/video/something-interesting</loc>
<lastmod>2012-04-09T19:04Z</lastmod>
<changefreq>yearly</changefreq>
<video:video>
<video:thumbnail_loc>http://example.com/sites/default/files/media-youtube/[youtube_ID].jpg</video:thumbnail_loc>
<video:content_loc>http://youtube.com/watch?v=[youtube_ID]</video:content_loc>
<video:title>Something Interesting</video:title>
<video:description>[short description from mRSS feed]</video:description>
<video:duration>260</video:duration>
<video:player_loc allow_embed="Yes">http://www.youtube.com/watch?v=[youtube_ID]</video:player_loc>
</video:video>
</url>

The extension classes can be found in xmlsitemap.elements.inc file, and only required minimal other changes to the module to incorporate. The video_props (video properties) module provides an extension class to:

  1. Identify the link as having video content.
  2. Retrieve and cache YouTube media descriptions, thumbnails, etc with mRSS request.
  3. Output relevant XML video sitemap elements where appropriate into the sitemap.

The video_props module is specifically designed to work with content from the media and media_youtube module, but the idea is that any module could theoretically be created to handle any sitemap content.

XerraX’s picture

Hey lemming. I cant get your changes running. Patch is getting some whitespace errors:

D:\testchamber>git clone --branch 7.x-2.x http://git.drupal.org/project/xmlsitem
ap.git
Cloning into 'xmlsitemap'...
remote: Counting objects: 10951, done.
remote: Compressing objects: 100% (3157/3157), done.
remote: Total 10951 (delta 8117), reused 10527 (delta 7740)
Receiving objects: 100% (10951/10951), 2.48 MiB | 460 KiB/s, done.
Resolving deltas: 100% (8117/8117), done.

D:\testchamber>cd xmlsitemap

D:\testchamber\xmlsitemap>git apply xmlsitemap_extensions_0.patch
xmlsitemap_extensions_0.patch:31: trailing whitespace.
 *  links to a document.
xmlsitemap_extensions_0.patch:32: trailing whitespace.
 *
xmlsitemap_extensions_0.patch:35: trailing whitespace.
 *  refer to the interface in case the implementation needs to be
xmlsitemap_extensions_0.patch:36: trailing whitespace.
 *  drastically different from what the default base class provides.
xmlsitemap_extensions_0.patch:39: trailing whitespace.

warning: squelched 75 whitespace errors
warning: 80 lines add whitespace errors.

When patched and additional module is installed, cron wont run anymore:
(which is needed for video_props)

Recoverable fatal error: Argument 2 passed to XMLSitemapWriter::writeSitemapElement() must implement interface IXMLSitemapElement, array given, called in D:\testserver\htdocs\www.test.com\sites\all\modules\xmlsitemap\xmlsitemap.xmlsitemap.inc on line 210 and defined in XMLSitemapWriter->writeSitemapElement() (Line 104 of D:\testserver\htdocs\www.test.com\sites\all\modules\xmlsitemap\xmlsitemap.xmlsitemap.inc).

PS: Sorry for possible bad english

Josher’s picture

sub

Anonymous’s picture

@josher: We stopped commenting to subscribe a while ago. Please use the big green "Follow" button at the top of the issue page to follow an issue.

Ken Hawkins’s picture

Just coming across this issue. It's coming up on being 4 years old and a full year since the last development-related comment.

Is there still a desire to have this included in the module?

tengoku’s picture

in my case i needed for a project months ago, I'm still interested in this for future projects...

vanvemden’s picture

Yes, have been looking for it too! I think it would be real helpful.

Rafal Lukawiecki’s picture

I am still very interested in this feature. We plan to enable video site maps this summer, one way or another, so it would be ideal to have the functionality ready for testing.

BeatnikDude’s picture

+1 for mobile

AgaPe’s picture

+ 1 for image and video

jcsnyder’s picture

+ 1 for images

Grayside’s picture

Issue summary: View changes
manoloka’s picture

+1 for images and video

mennonot’s picture

+1 for news

johntang’s picture

View source xml here: http://www.porwin.com/sitemap.xml

I'm just custom some code for my mobile sitemap, it is temporary solution and still subscribe for new function on new version XML Sitemap.

+1

eojthebrave’s picture

There's a patch in this issue #1370474: Create a hook to alter generated link xml, which doesn't necessarily solve this issue but it does make it pretty trivial to write a custom module that alters the XML sitemap so you can add custom elements like . And so that any of the module's that deal with audio/video/images could also implement those hooks and enhance a sites sitemap.

jboeger’s picture

+ 1 for News.

yeaha’s picture

FileSize
2.87 KB

Hi, I created a module to add multiple image field tags to the xmlsitemap based on the xmlsitemap api.

The patch to writeElement is needed to the xmlsitemap module to allow multiple image:image tags in the xml. do you want to add this to the core module?

My module has a settings page to choose the content type with images ( as string, feel free to create radiobuttons,...) that you want include in the sitemap + optionally a field to hide the image fields (also string) of the content type you don't want to see on the sitemap.
I'm using node load to load pages of the certain content type, not tested on many pages!(probably not so good there)

holyfire’s picture

@Dave Reid just wondering if it would be possible to get a summary of where this is headed and a relative timeline on this issue. In particular the issues surrounding News integration. Appreciate any additional clarification here.

Dave Reid’s picture

@holyfire: All the patches needed to support extended sitemaps have been committed to the latest version. I'm currently against committing actual modules like news and video sitemaps here since they tend to be very specific to the site and it's implementation.

holyfire’s picture

@Dave Reid looks like the Google News project will probably need to revise the documentation roadmap indicating future inclusion with XML sitemaps. Any clarification there would also be appreciated, this is pretty confusing and not clear as you look at either module. In addition it may be healthy to revisit a minimal maintenance mode on the Google News Module since direction has changed. Please clarify anything if I've misunderstood or misread this. I do appreciate the help.

bjalford’s picture

Does anyone have an example module of extending XML sitemap to have a Google News or video sitemap?

Anonymous’s picture

+1 for images! Media Sitemap & Google Image Sitemap are only halfway solutions, so it'd be nice to see an update in this module!

tengoku’s picture

FileSize
5.39 KB

thanks to @yeaha and #158 that works on my needs...

i'm using xmlsitemap 7.x-2.2 and no patch to xmlsitemap needed, i just needed to tweak the array that generates the module to work with format_xml_elements that sitemap uses..

also i'm altering the menu to update the xsl to make the sitemap show the count of the images..

uploading the updated module if anyone else need this (and i think this can be a separated module also) so @yeaha, why not put this in a sandbox?

thanks a lot!

JAINV18’s picture

@lemming #141 -
Hi,
I have to create a video sitemap for the videos hosted by Brightcove. I am using brightcove module to embed videos on page. Please suggest.

Thanks!!

agrozyme’s picture

FileSize
5.14 KB

fix some bug #164

Don't need to patch xmlsitemap.xmlsitemap.inc.
But it still has the patch file.

XerraX’s picture

there is a logical mistake in your module:

create a comma separated list of image field names you want to INCLUDE in the sitemap ex.: articlewithimages

should be content types

IckZ’s picture

Hey everyone! Thanks for this addon!
First it seemed that everything works as expected but:

1. the image counter in the sitemap template always shows 0 however there are images or not in the source
2. google WMT shows the correct count of images from the sitemap but does not indexes anyone of it. Maybe google wants to see the image style url of the images used in the nodes? What do you think about it?

danyg’s picture

Here is a big patch which adds the xmlsitemap_image module and handles the appearing of images in sitemap. It is built for the latest version of xmlsitemap (2.6). The module and the logic is based on the module of agrozyme (#166), but many things has been fixed and updated.
You have to enable the XMLSitemap Image module. Then you have to choose atleast 1 content type which has to be checked. The module checks the image fields of the content types, and automatically put the images of those fields into sitemap.xml. You can exclude those fields if you don't want enable them in sitemap.xml. You can add textfields to included fields, so it can read body, field_content, etc. fields and find the images HTML elements with regexp. And you can define css classes which has to be excluded from sitemap (so if you have an image in the body with 'hidden' class, it won't be available in sitemap.xml). THe current version can cooperate with paragraphs and field_collection_items, and try to discover the text fields within these bundles.
Let's give it a try and any feedbacks are welcomed.

danyg’s picture

Sorry, just a hotfix instead of the previous path. It changes the array brackets to be compatible backwards with PHP5.3.

danyg’s picture

Status: Postponed » Needs review

Please check the patches above. It handles images for XMLSitemap. I'm planning to work on solution for handling videos but it's more complex thanks to many options to embed videos into contents.

The last submitted patch, 141: xmlsitemap_extensions.patch, failed testing. View results

The last submitted patch, 120: xmlsitemap_changes.patch, failed testing. View results

The last submitted patch, 49: modify_link_hook.patch, failed testing. View results

The last submitted patch, 121: xmlsitemap_changes.patch, failed testing. View results

jpdaut’s picture

I have PHP5.6 and it did not like line 72 :

Warning: Illegal string offset 'und' in xmlsitemap_image_xmlsitemap_element_alter() (line 72 of /home/site2/public_html/sites/all/modules/xmlsitemap/xmlsitemap_image/xmlsitemap_image.module).

Notice: Undefined property: stdClass::$f in xmlsitemap_image_xmlsitemap_element_alter() (line 72 of /home/site2/public_html/sites/all/modules/xmlsitemap/xmlsitemap_image/xmlsitemap_image.module).

Warning: Invalid argument supplied for foreach() in xmlsitemap_image_xmlsitemap_element_alter() (line 72 of /home/site2/public_html/sites/all/modules/xmlsitemap/xmlsitemap_image/xmlsitemap_image.module).

I had to set 2 local variables first in order for it to work. Like this:

<?php
if (!empty($current_node->$field_name)) { // line 71
  $image_field_name = $current_node->$field_name;
  $images = $image_field_name[$current_node->language];
  foreach ($images as $image) {
    //etc.
?>

After that the images were written correctly to sitemap.xml.

Still, I had a remaining PHP warning :

Warning: Invalid argument supplied for foreach() in format_xml_elements() (line 1797 of /home/site2/public_html/includes/common.inc).

I don't understand why this warning, but at least the sitemap.xml is written correctly.

jpdaut’s picture

Also, there's something wrong in the code, haven't figured out what yet, but the xml output is missing the <image:image> key.

danyg’s picture

Thanks for checking the module @jpdaut.
And thanks for the suggestion you made, I placed it into the new patch.
And I fixed the problematic warnings and I found a huge error during generating the <image:image> key, so that is fixed.
If you or somebody else have time please check and review the new patch.

The interdiff totally removes the old xmlsitemap_image.module and adds the new one, that's why is bigger than the patch.

zemax’s picture

@danyg Thanks ! I had an issue when the field is not localised to the node language but left to LANGUAGE_NONE, so I added a test to target LANGUAGE_NONE when localised field is empty.

FiNeX’s picture

Hi, the <images> COUNT </images> is not valid according to Google Search Console. I've commented the code regarding the count and now Google is accepting the sitemap.

RaySilver’s picture

@danyg Thanks for all the new additions! I've used your patch and I'm trying to get the inline images that's in our ubercart product pages but nothing I've tried seems to make a difference and nothing shows up. I've tried body, body_value and any other field and it does nothing. Can you please let me know what I need to do or why those fields are not working? in the DB body_value is where the body content is.

Thank you

apaderno’s picture

Status: Needs review » Needs work
marcoka’s picture