Jump to:

10990 Posts in 2727 Topics by 1818 members

All other Modules

SilverStripe Forums » All other Modules » GoogleSitmap for SS3 doesn't work :/ (Willr's)

Discuss all other Modules here.

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

Page: 1
Go to End
Author Topic: 473 Views
  • mimamo
    Avatar
    Community Member
    22 Posts

    GoogleSitmap for SS3 doesn't work :/ (Willr's) Link to this post

    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

  • mahir
    Avatar
    Community Member
    11 Posts

    Re: GoogleSitmap for SS3 doesn't work :/ (Willr's) Link to this post

    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

  • Willr
    Avatar
    Forum Moderator
    5502 Posts

    Re: GoogleSitmap for SS3 doesn't work :/ (Willr's) Link to this post

    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

  • mimamo
    Avatar
    Community Member
    22 Posts

    Re: GoogleSitmap for SS3 doesn't work :/ (Willr's) Link to this post

    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

  • mahir
    Avatar
    Community Member
    11 Posts

    Re: GoogleSitmap for SS3 doesn't work :/ (Willr's) Link to this post

    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.

  • mimamo
    Avatar
    Community Member
    22 Posts

    Re: GoogleSitmap for SS3 doesn't work :/ (Willr's) Link to this post

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

  • mimamo
    Avatar
    Community Member
    22 Posts

    Re: GoogleSitmap for SS3 doesn't work :/ (Willr's) Link to this post

    Ok now it works
    Thx you very much.

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

    473 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.