Download the PHP package evanshunt/lumberjack-sort-and-summary without Composer
On this page you can find all versions of the php package evanshunt/lumberjack-sort-and-summary. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download evanshunt/lumberjack-sort-and-summary
More information about evanshunt/lumberjack-sort-and-summary
Files in evanshunt/lumberjack-sort-and-summary
Package lumberjack-sort-and-summary
Short Description Uses $summary_fields, $default_sort, and $plural_name for LumberJack when only one class is allowed for children
License MIT
Homepage http://github.com/evanshunt/lumberjack-sort-and-summary
Informations about the package lumberjack-sort-and-summary
Lumberjack Sort and Summary
A common use case for SilverStripe's Lumberjack module is the holder/page pattern. In this case, the holder page will only have one type of child page.
Because Lumberjack is built flexible enought to accommodate multiple types of child pages, some features that we might expect when only a single page type is allowed are missing. Such as:
- Using the default sort order for the child page type
- Listing the pages with the defined summary fields
- Labeling the listings with the name of the name of the child type instead of "Child Pages"
This module applies the above when a single child type is defined for the parent holder page.
Thanks to @bcairns for the code and documentation this module was based on
Installation
composer require evanshunt/lumberjack-sort-and-summary
Usage
Define $allowed_children
for the parent page. (Can be done either in yml config or model)
Define $plural_name
, $summary_fields
, and $default_sort
for child page.
Install and configure Lumberjack
Configuration
No additional configuration is needed. This module overloads methods in Lumberjack itself, to check the value of $allowed_children
on the parent class, and if only one class is defined, it will apply the changes based on the config values in the child class.
All versions of lumberjack-sort-and-summary with dependencies
silverstripe/cms Version ^5
silverstripe/lumberjack Version ^3