Coder Social home page Coder Social logo

creative-commoners / silverstripe-lumberjack Goto Github PK

View Code? Open in Web Editor NEW

This project forked from silverstripe/silverstripe-lumberjack

0.0 2.0 0.0 384 KB

Keep in control of large SiteTrees by using GridField to manage pages.

License: BSD 2-Clause "Simplified" License

PHP 86.65% Ruby 4.19% CSS 6.70% JavaScript 1.83% Scheme 0.63%

silverstripe-lumberjack's Introduction

SilverStripe Lumberjack

Build Status Latest Stable Version Latest Unstable Version License helpfulrobot

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: 3.1+

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

class NewsHolder extends Page {
	private static $extensions = array(
		'Lumberjack',
	);
	
	private static $allowed_children = array(
		'NewsArticle',
		'NewsPage',
	);
}

class NewsArticle extends Page {
	
	private static $show_in_sitetree = false;
	
	private static $allowed_children = array();
	
}

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.

:::yaml

BlogHolder:
  extensions:
    - 'Lumberjack'

BlogEntry:
  show_in_sitetree: false

silverstripe-lumberjack's People

Contributors

dhensby avatar micmania1 avatar robbieaverill avatar assertchris avatar spekulatius avatar christopherdarling avatar nightjar avatar purplespider avatar taitava avatar jorisdebonnet avatar michalkleiner avatar axllent avatar scott1702 avatar sheadawson avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.