Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

All other Modules /

Discuss all other Modules here.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

No URLs in Googlesitemaps


Go to End


8 Posts   1417 Views

Avatar
Rupert

Community Member, 10 Posts

20 June 2014 at 9:05pm

Hi,

I am using Silverstripe version 3.1
I installed Googlesitemaps from https://github.com/silverstripe-labs/silverstripe-googlesitemaps

It worked. Then I played around with my website (adding Google Analytics), and now all my URLs from:
/sitemap.xml/sitemap/SiteTree/1
have vanished. I tried rebuilding the database. I tried undoing all my changes, but nothing has worked.
How do I debug this, to find out what is going on??

Thanks.

Avatar
martimiz

Forum Moderator, 1391 Posts

20 June 2014 at 11:19pm

Edited: 20/06/2014 11:21pm

Just on the off chance - have you checked that for whatever reason the sitemap for your pages hasn't been set to 'do not index'?

Also you made sure that your pages are published and viewable?

Avatar
Rupert

Community Member, 10 Posts

20 June 2014 at 11:21pm

Edited: 20/06/2014 11:23pm

Where do I find that?

They are published and viewable. I can browse my website without a problem.

Avatar
martimiz

Forum Moderator, 1391 Posts

20 June 2014 at 11:39pm

Edited: 20/06/2014 11:41pm

You should know if your pages are published, I guess...

Edit: O sorry, you mentioned published and viewable already!

The other options you can find by editing a page in the CMS and going to the Settings tab.

You'll find the google sitemap dropdown, that will by default automatically decide the priority, but it can be set to 1-10 or 'do not index'.

Also you should find the acces rights, where everybody should be able to see the page.

Also see if 'show in search' is checked. By default the module will only display pages that are marked.

And just in case: check if there are no javascript errors, after you added analytics. I'm not sure how this would affect the sitemap, but no harm checking anyway...

Avatar
Rupert

Community Member, 10 Posts

20 June 2014 at 11:49pm

Edited: 20/06/2014 11:56pm

For my home page settings I have:

Visibility
Show in menus? "Ticked"
Show in search? "Ticked"

Who can view this page?
Inherit from parent page "Ticked"
Anyone
Logged-in users
Only these people (choose from list)

Who can edit this page?
Inherit from parent page "Ticked"
Anyone who can log-in to the CMS
Only these people (choose from list)

Manually specify a Google Sitemaps priority for this page (?)
Page Priority
1 - Most important

The settings for my other pages are the same except I have:

Manually specify a Google Sitemaps priority for this page (?)
Page Priority
Auto-set based on page depth

I thought it might have been a javascript conflict, so I tried removing all added code and reverting back to the last version before I lost my URLs, but that did not help. Also Google was able to scan the website and confirmed that the analytics code was ok (although I had to move it to with in the <head> for Google to confirm I owned the website.)

And just to show you, my website is http://www.englishediting.ch/

By the way, thanks heaps for trying to help :)

Avatar
martimiz

Forum Moderator, 1391 Posts

21 June 2014 at 4:45am

If I visit /sitemap.xml/sitemap/SiteTree/1, I see the following JavaScript error:

TypeError: table.config.parsers is undefined (in jquery.tablesorter.min.js)

But that may very well be the result of the fact that the table is empty, not the cause...

Have you tried re-installing GoogleSitemap?

Avatar
Rupert

Community Member, 10 Posts

23 June 2014 at 7:36am

I found my problem. It stems from the following code with in GoogleSitemapExtension.php

$hostHttp = parse_url(Director::protocolAndHost(), PHP_URL_HOST);
$objHttp = parse_url($this->owner->AbsoluteLink(), PHP_URL_HOST);

In my case I employ my own version of https://github.com/cbryer/Translatable-Domains (one that is compatible with subsites), which means that these 2 objects are sometimes never the same.

I also use subsites, and I am not sure but from first glance I do not think that GoogleSitemaps is compatible with subsites.

I am now looking for a viable solution.

Avatar
Rupert

Community Member, 10 Posts

30 June 2014 at 8:24am

Solved.

I have a strange setup where the URL is linked to the language. I therefore had to modify GoogleSitemap.php just a little bit.

Line 180: Just before: $instances = Versioned::get_by_stage('SiteTree', 'Live', $filter);

I had to add the following 2 line:
$curLoc = TranslatableDomains::getLocaleFromHost();
Translatable::set_current_locale($curLoc);
So Versioned::get_by_stage would return my translated pages.

All my sitemaps work now :)