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.

All other Modules /

Discuss all other Modules here.

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

GoogleSitmap for SS3 doesn't work :/ (Willr's)


Reply


7 Posts   518 Views

Avatar
mimamo

Community Member, 22 Posts

14 February 2013 at 3:42am

Hi,

I just found Willr's GoogleSitemap Module for SS3. I was very happy because I need a Sitemap really Urgent.
So i downloaded it, renamed it to "googlesitemaps" and uploaded it to the ss root.

than i put

if (class_exists('SiteTree')) {
   Object::add_extension('SiteTree', 'GoogleSitemapSiteTreeExtension');
}

into my _config.php and ran a dev/build.

But it doesn't work :/
i only got a new field at the settings of a page and thats all.
the /sitemap.xml only shows this content

<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<sitemap>
<loc>
http://test.testpage.firma.cc/sitemap.xml/sitemap/SiteTree/1
</loc>
<lastmod>2013-02-08</lastmod>
</sitemap>
</sitemapindex>

how can i fix it? :/ what did i wrong?

thank you very much for your help.

-hobenni

Avatar
mahir

Community Member, 11 Posts

14 February 2013 at 2:10pm

Hi hobenni.

First of all just be sure that you ran a dev/build after you uploaded the googlesitemaps module to your ss root.

I ll tell u about my configuration that works.

1) name of my module is googlesitemap
2) I dont have the following code in my mysite/_config.php
if (class_exists('SiteTree')) {
Object::add_extension('SiteTree', 'GoogleSitemapSiteTreeExtension');
}
3) I have only the following code in my googlesitemap /_config.php

<?php

// adds a rule to make www.site.com/sitemap.xml work
Director::addRules(100, array(
   'sitemap.xml' => 'GoogleSitemap'
));

// add the extension to pages
if (class_exists('SiteTree')) Object::add_extension('SiteTree', 'GoogleSitemapSiteTreeDecorator');

Hope that works for u too

Avatar
Willr

Forum Moderator, 5513 Posts

14 February 2013 at 9:04pm

What you see is correct. This is your sitemap index file. You'll see the link inside that file goes to the sitemap in the format you're likely expecting. To read more about index files check out http://www.sitemaps.org/protocol.html#index

Avatar
mimamo

Community Member, 22 Posts

14 February 2013 at 10:21pm

hi, thx for your replies,

1. i uploaded a backup of the files and the db
2. downloaded https://github.com/silverstripe-labs/silverstripe-googlesitemaps
3. renamed the folder to googlesitemap
4. uploaded it into ss root
5. dev/build
6. doesn't do anything with the _config.php

<?php

// add the extension to pages
if (class_exists('SiteTree')) {
   Object::add_extension('SiteTree', 'GoogleSitemapSiteTreeExtension');
}

// if you need to add this to DataObjects include the following in
// your own _config:

// GoogleSiteMap::register_dataobject('MyDataObject');

// adds a rule to make www.site.com/sitemap.xml work
Director::addRules(100, array(
'sitemap.xml' => 'GoogleSitemap'
));

But it still doesn't show my sites :/

i also tried

// adds a rule to make www.site.com/sitemap.xml work
Director::addRules(100, array(
'test.testpage.firma.cc/sitemap.xml' => 'GoogleSitemap'
));

but the same problem.

what should i do that it lists my sites?

thx hobenni

Avatar
mahir

Community Member, 11 Posts

15 February 2013 at 12:52am

Edited: 15/02/2013 12:54am

Hi Hobenni,

Seems like we have different googlesitemaps module. I checked yours and it is an upper version of the one I use.
And as Willr states, the previous results you obtained was correct also. It uses indexes which helps you to have 50.000 urls per sitemap.xml.

The module I use is attached if you want to try.

Avatar
mimamo

Community Member, 22 Posts

15 February 2013 at 1:23am

okay i'll try it. thank you very much!
i'll post my results in a few minutes ;)

Avatar
mimamo

Community Member, 22 Posts

15 February 2013 at 1:46am

Ok now it works :)
Thx you very much.

Homepage is not listed because it's the root site?