Permalink
Browse files

Better compatibility with SilverStripe 3.0

  • Loading branch information...
1 parent e801e91 commit 05d7bb8f82ae93ee955e39e1d276dc7994d7454f @UndefinedOffset UndefinedOffset committed Mar 25, 2012
Showing with 12 additions and 12 deletions.
  1. +4 −4 code/GoogleSitemapDecorator.php
  2. +8 −8 templates/GoogleSitemap.ss
@@ -6,14 +6,14 @@
*
* @package googlesitemaps
*/
-class GoogleSitemapDecorator extends DataObjectDecorator {
+class GoogleSitemapDecorator extends DataExtension {
}
/**
* @package googlesitemaps
*/
-class GoogleSitemapSiteTreeDecorator extends SiteTreeDecorator {
+class GoogleSitemapSiteTreeDecorator extends DataExtension {
function extraStatics() {
return array(
@@ -23,7 +23,7 @@ function extraStatics() {
);
}
- function updateCMSFields(&$fields) {
+ function updateSettingsFields(&$fields) {
$prorities = array(
'' => _t('SiteTree.PRIORITYAUTOSET', 'Auto-set based on page depth'),
'-1' => _t('SiteTree.PRIORITYNOTINDEXED', "Not indexed"), // We set this to -ve one because a blank value implies auto-generation of Priority
@@ -39,7 +39,7 @@ function updateCMSFields(&$fields) {
'0.1' => '10 - ' . _t('SiteTree.PRIORITYLEASTIMPORTANT', "Least important")
);
- $tabset = $fields->findOrMakeTab('Root.Content');
+ $tabset = $fields->findOrMakeTab('Root.Settings');
$message = "<p>";
$message .= sprintf(_t('SiteTree.METANOTEPRIORITY', "Manually specify a Google Sitemaps priority for this page (%s)"),
View
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
- <% control Items %>
- <url>
- <loc>$AbsoluteLink</loc>
- <lastmod>$LastEdited.Format(c)</lastmod>
- <% if ChangeFreq %><changefreq>$ChangeFreq</changefreq><% end_if %>
- <% if Priority %><priority>$Priority</priority><% end_if %>
- </url>
- <% end_control %>
+ <% loop $Items %>
+ <url>
+ <loc>$AbsoluteLink</loc>
+ <lastmod>$LastEdited.Format(c)</lastmod>
+ <% if $ChangeFreq %><changefreq>$ChangeFreq</changefreq><% end_if %>
+ <% if $Priority %><priority>$Priority</priority><% end_if %>
+ </url>
+ <% end_loop %>
</urlset>

0 comments on commit 05d7bb8

Please sign in to comment.