2017 © Pedro Peláez
 

silverstripe-vendormodule silverstripe-publishwithme

Publishes/Unpublishes versioned DataObjects that are attached to a Page or parent DataObject when the parent object is published.

image

christopherbolt/silverstripe-publishwithme

Publishes/Unpublishes versioned DataObjects that are attached to a Page or parent DataObject when the parent object is published.

  • Monday, June 11, 2018
  • by christopherbolt
  • Repository
  • 1 Watchers
  • 5 Stars
  • 124 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 2 Forks
  • 1 Open issues
  • 4 Versions
  • 17 % Grown

The README.md

PublishWithMe

Publishes/Un-publishes versioned DataObjects that are attached to a Page when the page is published., (*1)

Lets imagine that you have a staff profiles page where each staff member is a DataObject in a has_many relation. Without any versioning edits to a staff member would be published immediately breaking workflow approval processes and breaking the draft, publish and history functionality of Silverstripe. Or if they did have the Versioned extension they would need to be published independantly from the page which complicates workflow. This module allows those edits to be published when the page is published. Also supports un-publishing, revert to live and history rollback with the page. This allows objects to behave as if they are part of the page., (*2)

Upgrading from SilverStripe 3

Most of the functionality of this plugin is now built into SilverStripe 4 and can be enabled by using the $owns config that is baked into SS4. To upgrade please replace the $publish_with_me config with $owns. In SS4 all this plugin does is enhance the Saved / Published button to show that the page needs publishing if any $owns objects have unpublished changes., (*3)

Requirements

SS 4.x, see 1.0 branch for SS 3.x, (*4)

Usage

Add the PublishWithMe extension to your page (or parent DataObject):, (*5)

private static $extensions = array(
    "PublishWithMe"
);

Still on your page (or parent DataObject) define which relations should be managed by this extension, this is a list of array keys from your has_one and/or has_many relations, this just now uses the $owns config that is built into SS4:, (*6)

private static $owns = array(
    'Staff',
);

The DataObjects to be published with the page must have the Versioned extension, in the example above you would add this to your StaffMember object:, (*7)

private static $extensions = array(
    Versioned::class,
);

If your dataobjects themselves contain relations that should be published with the page then also add the PublishWithMe extension and the $owns config and ensure that the child data objects have the Versioned extension etc., (*8)

Installation

composer require christopherbolt/silverstripe-publishwithme ^2

The Versions

11/06 2018

2.0.x-dev

2.0.9999999.9999999-dev http://github.com/christopherbolt/publishwithme

Publishes/Unpublishes versioned DataObjects that are attached to a Page or parent DataObject when the parent object is published.

  Sources   Download

The Requires

 

by Chris Bolt

24/03 2018

dev-master

9999999-dev http://github.com/christopherbolt/publishwithme

Publishes/Unpublishes versioned DataObjects that are attached to a Page or parent DataObject when the parent object is published.

  Sources   Download

The Requires

 

by Chris Bolt

01/03 2018

1.0.x-dev

1.0.9999999.9999999-dev http://github.com/christopherbolt/publishwithme

Publishes/Unpublishes versioned DataObjects that are attached to a Page or parent DataObject when the parent object is published.

  Sources   Download

The Requires

 

by Chris Bolt

01/03 2018

v1.0.1

1.0.1.0 http://github.com/christopherbolt/publishwithme

Publishes/Unpublishes versioned DataObjects that are attached to a Page or parent DataObject when the parent object is published.

  Sources   Download

The Requires

 

by Chris Bolt