I recently had a requirement for rewriting "outbound" links included in an xmlsitemap based on node type. This is relatively easy to do using hook_url_outbound_alter() however we don't pass the node (bundle) type information exposed inside the xmlsitemap_link array given to url(), though most of the other columns from {xmlsitemap} are.

This is a simple patch to include those two additional columns. This should be backwards-compatible, as the array we're adding to is keyed, anyway.

CommentFileSizeAuthor
xmlsitemap-link_data-0.patch696 bytesbradjones1
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Anonymous’s picture

Category: task » feature
Chris Matthews’s picture

Issue summary: View changes
Status: Needs review » Needs work
Issue tags: +Needs reroll

The 6 year old patch to xmlsitemap.generate.inc does not apply to the latest xmlsitemap 7.x-2.x-dev and if still applicable needs a reroll.

Checking patch xmlsitemap.generate.inc...
error: while searching for:
  $link_count = 0;

  $query = db_select('xmlsitemap', 'x');
  $query->fields('x', array('loc', 'lastmod', 'changefreq', 'changecount', 'priority', 'language', 'access', 'status'));
  $query->condition('x.access', 1);
  $query->condition('x.status', 1);
  $query->orderBy('x.language', 'DESC');

error: patch failed: xmlsitemap.generate.inc:150
error: xmlsitemap.generate.inc: patch does not apply