Keep in control of large SiteTrees by using GridField to manage pages.
PHP CSS Ruby JavaScript Scheme
Clone or download
Pull request Compare This branch is 155 commits ahead of micmania1:master.
robbieaverill Merge pull request #82 from creative-commoners/pulls/master/add-suppo…
…rted-module-badge

Add supported module badge to readme
Latest commit d09771e Jun 18, 2018
Permalink
Failed to load latest commit information.
.tx Add localisation May 26, 2015
css update "State" icons (Published / Draft) to font versions Jan 13, 2018
javascript Initial Commit Dec 13, 2014
lang move HTML out of .yml translations Jan 15, 2018
scss update "State" icons (Published / Draft) to font versions Jan 13, 2018
src Merge pull request #80 from creative-commoners/pulls/2.0/modified-state Apr 20, 2018
templates/SilverStripe/Lumberjack/Forms Use "src" instead of "code" Dec 20, 2016
tests FIX Update Travis config, PSR-4 and namespaces for SS4 Jun 22, 2017
.editorconfig Added standard editor config Nov 19, 2015
.gitattributes Added standard git attributes Nov 19, 2015
.gitignore Added composer Dec 13, 2014
.scrutinizer.yml Use "src" instead of "code" Dec 20, 2016
.travis.yml FIX Update Requirements API, vendorise module, update i18n translations Oct 18, 2017
.upgrade.yml FIX Move upgrade mapping to root folder Jan 24, 2017
README.md Add supported module badge to readme Jun 15, 2018
_config.php FIX Update Requirements API, vendorise module, update i18n translations Oct 18, 2017
changelog.md Add changelog for 1.1.4 May 18, 2016
code-of-conduct.md Added standard code of conduct Nov 21, 2015
codecov.yml FIX Update Travis configuration to be standalone Sep 19, 2017
composer.json FIX Update Requirements API, vendorise module, update i18n translations Oct 18, 2017
config.rb Initial Commit Dec 13, 2014
license.md Updated license year Dec 31, 2015
phpunit.xml.dist FIX Update Requirements API, vendorise module, update i18n translations Oct 18, 2017

README.md

SilverStripe Lumberjack

Build Status Scrutinizer Code Quality SilverStripe supported module Code coverage

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.

Requirements

  • silverstripe/cms: 4.0+

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 NewsArticles and NewsPages. We want to display NewsPage in the site tree but we want to display NewsArticles 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