It would be nice to be able to export the xmlsitemap table records to code so they can be deployed easily. The variable table stuff is already easily exported. Perhaps use ctools for this feature.

Comments

Dave Reid’s picture

Status: Active » Postponed (maintainer needs more info)

Stuff from {xmlsitemap}? There may be *lots* of data in there and I'm not sure if that's a good idea. If anything we'd only export link data that has custom inclusion/exclusion or priority. Everything else can be rebuilt.

moshe weitzman’s picture

sorry, i meant xmlsitemap_sitemap table. I think it would make sense to break that table into two. The generated data like link count would go into a new table.

the basic intent is that you can export to code and then roll to prod and have its cron generate the db data and files from there.

Dave Reid’s picture

Status: Postponed (maintainer needs more info) » Postponed

Ah yeah that makes much more sense. This is something I'd love to do. There's a lot of more-than-simple stuff that needs to happen when sitemaps are saved/updated so I'd need to do more research on how it works with ctools exporting. Especially with how we need to handle sitemap IDs.

Dave Reid’s picture

Ugh, this really just complicates a whole *lot* of stuff I did not anticipate and did not plan to code before reaching 2.0. I might have to postpone this for 3.0. Really most sites will only have one sitemap, it's not a huge deal to add/edit one sitemap.

Dave Reid’s picture

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

+1 on this feature. It would be great to be able to include this in Drupal distributions but it takes a lot of documentation to instruct people how to set up includes and excludes on every new install.

jherencia’s picture

Gold’s picture

From the point of view of deploying the details in xmlsitemap_sitemap after enabling the module in a hook_update_N() call I added the following;

  // Add our sitemaps
  $sitemap = new stdClass;
  $sitemap->smid = NULL;
  $sitemap->context = array('language' => 'en');
  xmlsitemap_sitemap_save($sitemap);
  $sitemap = new stdClass;
  $sitemap->smid = NULL;
  $sitemap->context = array('language' => 'mi');
  xmlsitemap_sitemap_save($sitemap);

  // Clean up the default entry that was made when the module was enabled.
  $context = array();
  $smid = xmlsitemap_sitemap_get_context_hash($context);
  db_delete('xmlsitemap_sitemap')
    ->condition('smid', $smid)
    ->execute();