Jump to:

10994 Posts in 2728 Topics by 1819 members

All other Modules

SilverStripe Forums » All other Modules » Add dynamic sites to Google Sitemap?

Discuss all other Modules here.

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

Page: 1 2
Go to End
Author Topic: 2374 Views
  • danzzz
    Avatar
    Community Member
    175 Posts

    Add dynamic sites to Google Sitemap? Link to this post

    hi there,

    I generate pages from dataobjects, so this pages are not in the SiteTree. What would be the best solution to have this pages also in the sitemap.xml? Does anybody solved such a problem yet?

    thx

  • Willr
    Avatar
    Forum Moderator
    5508 Posts

    Re: Add dynamic sites to Google Sitemap? Link to this post

    Download the latest google sitemap module (master) - https://github.com/silverstripe-labs/silverstripe-googlesitemaps this includes the ability to define dataobjects in the sitemap.xml

  • danzzz
    Avatar
    Community Member
    175 Posts

    Re: Add dynamic sites to Google Sitemap? Link to this post

    Cool, looks great.

    Daniel

  • Ryan M.
    Avatar
    Community Member
    309 Posts

    Re: Add dynamic sites to Google Sitemap? Link to this post

    Hey Will, what's your recommended way of adding DataObjects to the sitemap? I downloaded and checked out the code, and it seems I'm supposed to add the list of DataObjects to the array on line 44 of GoogleSitemap.php. So I put it there.
    I also added GoogleSitemap::enable_google_notificaton(); to my config file, but that triggers a blank page on all pages of my site.

  • Ryan M.
    Avatar
    Community Member
    309 Posts

    Re: Add dynamic sites to Google Sitemap? Link to this post

    Update:

    Also tried GoogleSitemap::register_dataobject('Project', 'monthly', '0.9'); in my config file with the google notification, produces the same result as before.

  • danzzz
    Avatar
    Community Member
    175 Posts
  • Ryan M.
    Avatar
    Community Member
    309 Posts

    Re: Add dynamic sites to Google Sitemap? Link to this post

    Awesome! I was nearly ready to code my own modifications to googlesitemaps until you posted this.

  • Webdoc
    Avatar
    Community Member
    332 Posts

    Re: Add dynamic sites to Google Sitemap? Link to this post

    How i can get the dataobject location adress showing up in sitemap.xml
    it gives it so
    <url>
    <loc/> *this is missing here
    <lastmod>2011-12-09T14:18:53+02:00</lastmod>
    <changefreq>hourly</changefreq>
    <priority>0.9</priority>
    </url>

    The pagetype is named Toodelist and it haves dataobject Toode

    added in toode.php those lines but it didnt help:
    //Return the Name as a menu title
       public function MenuTitle()
       {
       return $this->Tootenimi;
       }

       //Ensure that the DO shows up in menu (unclear whether this is needed or not)
           public function canView()
       {
       return $this->Toodelist()->canView();
       }

    2374 Views
Page: 1 2
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.