silverstripe / lumberjack
A module to make managing pages in a GridField easy without losing any of the functionality that you're used to in the CMS.
Installs: 900 176
Dependents: 38
Suggesters: 2
Security: 0
Stars: 33
Watchers: 8
Forks: 45
Open Issues: 12
Type:silverstripe-vendormodule
Requires
- php: ^8.3
- silverstripe/cms: ^6
- silverstripe/framework: ^6
Requires (Dev)
- dev-master
- 4.x-dev
- 4.0.x-dev
- 4.0.0-alpha1
- 3.x-dev
- 3.2.x-dev
- 3.2.0
- 3.2.0-rc1
- 3.2.0-beta1
- 3.1.x-dev
- 3.1.2
- 3.1.1
- 3.1.0
- 3.1.0-rc1
- 3.1.0-beta1
- 3.0.x-dev
- 3.0.3
- 3.0.2
- 3.0.1
- 3.0.0
- 3.0.0-rc1
- 3.0.0-beta1
- 2.x-dev
- 2.3.x-dev
- 2.3.5
- 2.3.4
- 2.3.3
- 2.3.2
- 2.3.1
- 2.3.0
- 2.2.x-dev
- 2.2.1
- 2.2.0
- 2.1.x-dev
- 2.1.1
- 2.1.0
- 2.0.x-dev
- 2.0.2
- 2.0.1
- 2.0.0
- 2.0.0-rc1
- 2.0.0-alpha1
- 1.3.x-dev
- 1.3.4
- 1.3.3
- 1.3.2
- 1.3.1
- 1.3.0
- 1.2.0
- 1.1.5
- 1.1.4
- 1.1.3
- 1.1.2
- 1.1.1
- 1.1.0
- 1.0.1
- 1.0.0
- dev-dependabot/npm_and_yarn/nanoid-3.3.8
- dev-pulls/3/update-js-1725231961
This package is auto-updated.
Last update: 2024-12-14 09:55:05 UTC
README
A module to make managing pages in a GridField easy without losing any of the functionality that you're used to in the CMS.
This is intended to be used in cases where the SiteTree grows beyond a manageable level. eg. blogs, news sections, shops, etc.
This module was born out of and decoupled from micmania1/silverstripe-blog.
Installation
composer require silverstripe/lumberjack
Features
- Easily define which page types to show in the SiteTree and which to manage in a GridField.
- Keep all functionality that comes with the CMS, including versioning and preview.
Usage
In this example we have a NewsHolder
page which is the root of our news section, containing NewsArticle
s and
NewsPage
s. We want to display NewsPage
in the site tree but we want to display NewsArticle
s in a GridField
.
<?php namespace MyModule\PageTypes; use Page; use SilverStripe\Lumberjack\Model\Lumberjack; class NewsHolder extends Page { private static $extensions = [ Lumberjack::class, ]; private static $allowed_children = [ NewsArticle::class, NewsPage::class, ]; }
<?php namespace MyModule\PageTypes; use Page; class NewsArticle extends Page { private static $show_in_sitetree = false; private static $allowed_children = []; }
<?php namespace MyModule\PageTypes; use Page; class NewsPage extends Page { private static $show_in_sitetree = true; }
If show_in_sitetree
is not explicitly defined on a class, then it will default to true. You can add this setting to
core classes and modules using the YAML config system. It is not recommended to add the LumberJack extension to
the SiteTree
or Page
class.
SilverStripe\Blog\Model\Blog: extensions: - SilverStripe\Lumberjack\Model\Lumberjack SilverStripe\Blog\Model\BlogPost: show_in_sitetree: false