mirror of
https://github.com/wilr/silverstripe-googlesitemaps.git
synced 2024-10-22 09:05:48 +00:00
ENHANCEMENT: added ability to define a custom prority to dataobjects.
This commit is contained in:
parent
805c7e2ee4
commit
65c59fc020
@ -10,7 +10,7 @@
|
||||
* sitemap whenever the GoogleBot visits your website.
|
||||
*
|
||||
* Enabling notification of Google after every publish (in your _config.php):
|
||||
|
||||
*
|
||||
* <example>
|
||||
* GoogleSitemap::enable_google_notificaton();
|
||||
* </example>
|
||||
@ -79,12 +79,15 @@ class GoogleSitemap extends Controller {
|
||||
public static function register_dataobject($className, $changeFreq = 'monthly', $priority = '0.6') {
|
||||
if (!self::is_registered($className)) {
|
||||
Object::add_extension($className, 'GoogleSitemapDecorator');
|
||||
|
||||
self::$google_sitemap_dataobjects[] = $className;
|
||||
if ($changeFreq === null) {
|
||||
|
||||
if (!$changeFreq) {
|
||||
self::$google_sitemap_dataobjects_changefreq[] = "monthly";
|
||||
} else {
|
||||
self::$google_sitemap_dataobjects_changefreq[] = $changeFreq;
|
||||
}
|
||||
|
||||
self::$google_sitemap_dataobjects_priority[] = $priority;
|
||||
}
|
||||
}
|
||||
@ -132,7 +135,7 @@ class GoogleSitemap extends Controller {
|
||||
|
||||
/**
|
||||
* Returns all the links to {@link SiteTree} pages and
|
||||
* {@link DataObject} urls on the page
|
||||
* {@link DataObject} urls on the page.
|
||||
*
|
||||
* @return DataObjectSet
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user