Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

 

Four One Zero! SilverStripe 4.1.0 is out

4.1.0 has now been released, and with it comes some of the most highly-requested features from the SilverStripe community! Take a look at all the extra functionality that comes with this release.

Read post

SilverStripe 4 continues to grow and mature, as we push out our first minor release of this major version. This update includes many highly-requested features from the community, and addresses many use cases that arose since we released 4.0.0 late last year.

Public webroot

As the most major security feature implemented since protected assets, SilverStripe 4.1 will now allow all assets and site code to be stored safely away from the public webroot. Rather than relying on .htaccess rules or other server configuration to secure non-public resources, you can simply create a public folder within your project, and set this as your webroot.

By default all new projects created with 4.1 will have a public folder created out of the box, but existing projects can have a public folder by upgrading.

For more information on the benefits of this new feature, and how to upgrade your website to ensure the best security, please check out the 4.1.0 upgrade guide.

screenshot public structure

Unversioned ownership

As requested, many features which once were restricted to versioned-only objects are now available for all classes; You can now use ownership to link trees of dependant objects, versioned or not, and publish them in complete changesets at one time.

E.g.

class Banner extends DataObject
{
    private static $owns = [ 'Image' ];

    private static $has_one = [
        'Image' => Image::class,
    ];
}

Recursive Duplication

Ownership is now useful not only for publishing of records, but also allows for configuration of duplication of trees of content. By default, any record with owns will duplicate any exclusively owned content attached to it, ensuring that duplicated records are as complete as their original.

A new config cascade_duplicates is now available in case that this logic should be customised on a per-record basis.

class Page extends SiteTree
{
    private static $cascade_duplicates = [ 'Banners' ];

    private static $has_many = [
        'Banners' => Banner::class
    ];
}

Better versioned record user interface

When working with records, either versioned, or containing versioned owned records, we have improved the GridField user interface to better communicate and ensure consistent publishing of content.

Records which have owns will now have an updated save interface, as represented below:

Screen Shot 2018 02 02 at 3.11.27 PM

When the record is saved, all draft objects attached to this record will be published automatically.

We have also added additional visual indicators for versioned records, both in the breadcrumbs, as well as in gridfields.

screenshot versioned breadcrumbsscreenshot versioned column

Pattern Library

Now available for UX and react developers is the new pattern library.

You can get this setup by installing 4.1.0 and running the following commands:

$ cd vendor/silverstripe/admin
$ yarn install
$ yarn pattern-lib
Storybook started on => http://localhost:6006/

Then you can start up the storybook in your web browser. 

Screen Shot 2018 02 05 at 5.07.30 PM

Checking out the upgrade

You can check out 4.1.0 with composer; Simply run the command below to get started.

composer create-project silverstripe/installer ./ss41 4.1.0

Don't forget to check out the 4.1.0 upgrading guide for information on upgrading your project.

To get announcements straight to your inbox for upcoming releases you can also subscribe to our release announcements on Google Groups.

About the author
Damian Mooyman

Damian is a developer who has been stuck into SilverStripe for a few years, and a part of the company for a while too. He’ll be around on github under the handle @tractorcow if you need him.

Post your comment

Comments

No one has commented on this page yet.

RSS feed for comments on this page | RSS feed for all comments