my bad forgot to add
public function AbsoluteLink() {
return Director::absoluteURL($this->Link());
}
This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.
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.
my bad forgot to add
public function AbsoluteLink() {
return Director::absoluteURL($this->Link());
}
He guys,
I have the same problem than danzzz. I generate pages from dataobjects and I need a sitemap-module that add this pages to sitemap.xml and works on Silverstripe 2.4.7.
The link from Willr (https://github.com/silverstripe-labs/silverstripe-googlesitemaps) only contains a module that requires Silverstripe 3.0
Is there somewhere a module for 2.4.7?
It should work, I'm using it on one of my 2.4.x sites. Can't remember if I had to make hacks or not though.
Strange, I´ve got this error if I start dev/build?flush=1: Fatal error: Class 'DataExtension' not found in /www/htdocs/xxxx/projekte/mysite-cms2/googlesitemaps/code/GoogleSitemapDecorator.php on line 9
Update - I found this module:
https://github.com/silverstripe-labs/silverstripe-googlesitemaps/tree/0.2
But it doesn´t add the dataobjects as pages right. I´ve got this:
<url>
<loc>
http://furnifocus.de.XXXX.kasserver.com/projekte/XXX-cms2/wohnwelten/garten/
</loc>
<lastmod>2012-03-30T12:13:22+02:00</lastmod>
<changefreq>weekly</changefreq>
<priority>0.9</priority>
</url>
<url>
<loc/>
<lastmod>2012-04-18T16:13:23+02:00</lastmod>
<changefreq>monthly</changefreq>
<priority>0.6</priority>
</url>
<url>
<loc/>
<lastmod>2012-04-11T09:56:34+02:00</lastmod>
<changefreq>monthly</changefreq>
<priority>0.6</priority>
</url>
<url>
<loc/>
<lastmod>2012-04-13T09:50:40+02:00</lastmod>
<changefreq>monthly</changefreq>
<priority>0.6</priority>
</url>
Do your dataobjects have AbsoluteLink methods defined? See the tests for an example https://github.com/silverstripe-labs/silverstripe-googlesitemaps/blob/master/tests/GoogleSitemapTest.php#L98
Hi Willr,
how can I define the AbsoluteLink method? I´ve tried to add:
public function AbsoluteLink() {
return Director::absoluteURL($this->Link());
}
to my datadobject class, but this has no effect.
I´ve added: public static $google_sitemap_dataobjects = array('Product'); to the GoogleSitemap.php
and I´ve added GoogleSiteMap::register_dataobject('Product'); to my _config.
It still doesn´t work. I´ve tried your module (https://github.com/silverstripe-labs/silverstripe-googlesitemaps) again, but probably it´s only for Silverstripe 3.0.
Bereusei, no the module supports 2.4 with the 0.2 branch (http://www.silverstripe.org/google-sitemaps-module/)
It's quite a simple template, I would debug
public function AbsoluteLink() {
$url = Director::absoluteURL($this->Link());
var_dump($url);
return $url;
}
You should see all your urls. If that happens and the XML source still doesn't have it then try with a ?flush - site.com/sitemap.xml?flush=1. If you don't get a list of URL's then your object hasn't been registered.