Here is the thread aiming at automating the diverse tasks of domain sitemap (function domain_xmlsitemap_domainupdate)

1st automation : automatically add the sitemap upon domain creation :
Quite easy :

 if ($op == 'create') {
    // If domain was created, create sitemap.
    $sitemap=array();
    $sitemap['context']['domain']=$domain['domain_id'];
    xmlsitemap_sitemap_save($sitemap);
  }

2nd : automatically delete the sitemap upon domain deletion.
A bit more tricky : function that should be called is xmlsitemap_sitemap_delete with the id of the sitemap as parameter. Before, xmlsitemap_sitemap_load_by_context should be called to load the id of the sitemap.

Last question is : is anything needed on update? I would say no, but we'll have to doublecheck that.

Comments

dave reid’s picture

Ideally we'd support changing a domain and deleting a domain. I don't think automatically adding sitemaps when new domains are added is a great idea though.

eme’s picture

From what I know, there is nothing to do on update, as the id taken is not the name but the domain_id. So updating a domain does not change anything.

For the automation of the new sitemap, an option should maybe be added. That was the most important for me (as I could not explain my clients that they shoud add the sitemap when adding a new domain). But I agree that maybe some people won't want this option (?).

ayesh’s picture

Is this feature already implemented ?

I'm using DA for a domain parking system so automating this is very useful for me.

Can you say the lines that I should patch ?

ayesh’s picture

- an accidently posted duplicate of above comment -