From c0895803dbad64979ced1741f39394e914d2e515 Mon Sep 17 00:00:00 2001 From: Shaun Cockerill Date: Mon, 26 Nov 2018 10:03:29 +0800 Subject: [PATCH 1/2] FIX: Update Blog archive date formats for SS4 --- src/Model/BlogController.php | 4 ++-- templates/SilverStripe/Blog/Model/Layout/Blog.ss | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Model/BlogController.php b/src/Model/BlogController.php index 7972346..60b11ea 100644 --- a/src/Model/BlogController.php +++ b/src/Model/BlogController.php @@ -396,9 +396,9 @@ class BlogController extends PageController if ($this->owner->getArchiveDay()) { $date = $this->owner->getArchiveDate()->Nice(); } elseif ($this->owner->getArchiveMonth()) { - $date = $this->owner->getArchiveDate()->format('F, Y'); + $date = $this->owner->getArchiveDate()->format('MMMM, y'); } else { - $date = $this->owner->getArchiveDate()->format('Y'); + $date = $this->owner->getArchiveDate()->format('y'); } $items[] = _t( diff --git a/templates/SilverStripe/Blog/Model/Layout/Blog.ss b/templates/SilverStripe/Blog/Model/Layout/Blog.ss index 8d04d49..2c21846 100644 --- a/templates/SilverStripe/Blog/Model/Layout/Blog.ss +++ b/templates/SilverStripe/Blog/Model/Layout/Blog.ss @@ -9,9 +9,9 @@ <% if $ArchiveDay %> $ArchiveDate.Nice <% else_if $ArchiveMonth %> - $ArchiveDate.format('F, Y') + $ArchiveDate.format('MMMM, y') <% else %> - $ArchiveDate.format('Y') + $ArchiveDate.format('y') <% end_if %> <% else_if $CurrentTag %> <%t SilverStripe\\Blog\\Model\\Blog.Tag 'Tag' %>: $CurrentTag.Title From 233a5e639796e330f887a2f6ecf19001ef884541 Mon Sep 17 00:00:00 2001 From: Robbie Averill Date: Wed, 5 Sep 2018 14:56:05 +0200 Subject: [PATCH 2/2] FIX Blog profile summary field is always inserted before the profile image field --- src/Model/BlogMemberExtension.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Model/BlogMemberExtension.php b/src/Model/BlogMemberExtension.php index 73eadd2..54c283d 100644 --- a/src/Model/BlogMemberExtension.php +++ b/src/Model/BlogMemberExtension.php @@ -7,6 +7,7 @@ use SilverStripe\Blog\Forms\GridField\GridFieldConfigBlogPost; use SilverStripe\Forms\FieldList; use SilverStripe\Forms\GridField\GridField; use SilverStripe\Forms\Tab; +use SilverStripe\Forms\TextareaField; use SilverStripe\ORM\DataExtension; use SilverStripe\Security\Member; use SilverStripe\View\Parsers\URLSegmentFilter; @@ -107,7 +108,6 @@ class BlogMemberExtension extends DataExtension $fields->removeByName('URLSegment'); // Remove the automatically-generated posts tab. - $fields->removeFieldFromTab('Root', 'BlogPosts'); // Construct a better posts tab. @@ -127,6 +127,13 @@ class BlogMemberExtension extends DataExtension $fields->addFieldToTab('Root', $tab); + // Ensure blog fields are added after defaults + $fields->addFieldToTab( + 'Root.Main', + TextareaField::create('BlogProfileSummary'), + 'BlogProfileImage' + ); + return $fields; } }