purplespider/lumberjack-plus

Extras for the Silverstripe Lumberjack module

Installs: 4

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Type:silverstripe-vendormodule

1.0.1 2023-07-13 10:09 UTC

This package is auto-updated.

Last update: 2024-10-13 12:58:00 UTC


README

Adds a few extra features to the Lumberjack module.

Funcationality

1. Ability to make the Lumberjack tab the default tab for the page

To make the tab always first:

function getLumberjackTabPosition()
{
    return "first";
}

To make the tab appear first, unless the page is new and the GridField is empty:

function getLumberjackTabPosition()
{
    return "first-unless-new";
}

2. Incorporates LumberjackSortAndSummaryExtension from evanshunt.

This enables $plural_name, $summary_fields, and $default_sort when there is jsut a single type of child page. See docs.

Installation

composer require purplespider/lumberjack-plus

Documentation

To enable:

Add the LumberJackplus extension INSTEAD of Lumberjack, e.g.

private static $extensions = [
    LumberJackplus::class,
];

Or, via `config.yml``:

ExampleSite\NewsHolder:
  extensions:
    - PurpleSpider\LumberjackPlus\LumberjackPlus

Or, to use for ALL Lumberjack instances in your project, use Injector in your site's config.yml:

SilverStripe\Core\Injector\Injector:
  SilverStripe\Lumberjack\Model\Lumberjack:
    class: PurpleSpider\LumberjackPlus\LumberjackPlus