Hi,

I installed both XML Sitemap and Domain XML Sitemap for provide a xml sitemap on 2 websites.
The content of both xml sitemap is the same.
How do I configure this module for works fine?

Thanks

Comments

neilnz’s picture

Yeah I have the same problem. Whichever domain I run the generate batch from seems to populate both domains' sitemaps with identical URLs.

Running XML Sitemap 6.x-2.0-beta2 1297291363
Domain XML Sitemap 6.x-1.0-beta2 1297438017

I'm trying to track it down.

neilnz’s picture

The problem appears to be the hooks in domain_xmlsitemap only apply to entries in the xmlsitemap table of type "node". If you use some other method of adding pages, such as menus (which I use), it's inserting entries for node pages, but those aren't joined across to the domain_access table, so are included by default.

I'm looking at enhancing the join to include node URLs that are of other types.

jwilson3’s picture

Same problem here.

@neilnz were you able to get anywhere on this?

jwilson3’s picture

Title: Same content on all XML sitemap » Support node inclusion/exclusion by menus

Let's narrow down the scope to the one use case that is actually listed here, and confirmed by two of us to be causing issues.

There is a similar issue for Domain Taxonomy support as well: #1067454: Domain Taxonomy Module Support

If other use cases appear, let's add them as separate issues so they can be tackled and tested one by one.

drone’s picture

Seems like there's no any progress on this, eh?

emfabric’s picture

In my case, I have a distinct menu for each domain. If you add a custom module to your site, it's relatively easy to prevent a menu from being included in a given domain's sitemap.

The code from my site's module:

// there are two domains, domain id 1 and domain id 2
// domain id 1 is associated with taxonomy tags_primary and with menu main-menu
// domain id 2 is associated with taxonomy tags_subsite and with menu menu-subsite
function mymodule_query_xmlsitemap_generate_alter(QueryAlterableInterface $query) {

	$sitemap = $query->getMetaData('sitemap');
	
	
	if ($sitemap->context['domain'] && ($sitemap->context['domain'] == 2)) {
		// exclude terms in tags_primary for the subsite
		$query->condition('subtype','tags_primary','<>');
		// exclude links in main-menu for subsite
		$query->condition('subtype','main-menu','<>');
	} else {
		// exclude terms in tags_subsite for the main site
		$query->condition('subtype','tags_subsite','<>');
		// exclude links in main-subsite for main site
		$query->condition('subtype','menu-subsite','<>');
	}

}

This is what we are using on http://www.fabriciuslaw.com and http://www.eastwakebankruptcy.com to clean up their sitemaps. For my purposes, it worked fine to hard-code the domain ids and menu names into the module. As far as I know, there isn't any module seeking or storing user domain preferences on a per-menu basis.