Download & Extend

Make xmlsitemap record exportable

Project:XML sitemap
Version:7.x-2.x-dev
Component:xmlsitemap.module
Category:feature request
Priority:normal
Assigned:Unassigned
Status:postponed

Issue Summary

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

#1

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.

#2

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.

#3

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.

#4

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.

#5

Version:6.x-2.x-dev» 7.x-2.x-dev

#6

+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.

#7

#8

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;

<?php
 
// 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();
?>
nobody click here