2017 © Pedro Peláez
 

silverstripe-module silverstripe-global-content

Silverstripe SiteConfig like interface for global content that content-authors can access

image

webfox/silverstripe-global-content

Silverstripe SiteConfig like interface for global content that content-authors can access

  • Tuesday, May 16, 2017
  • by webfox
  • Repository
  • 2 Watchers
  • 3 Stars
  • 1,715 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 0 Open issues
  • 6 Versions
  • 7 % Grown

The README.md

silverstripe-global-content

Installation

This module only supports installation via composer., (*1)

Run the following to add this module as a requirement and install it via composer., (*2)

composer require "webfox/silverstripe-global-content"

then browse to /dev/build?flush=all, (*3)

Requirements

  • SilverStripe 3.2+
  • PHP 5.4+

Module Overview

This module adds a convenient SiteConfig like interface for managing global content. Useful for when you want global content but don't want to give content-authors access to SiteConfig, (*4)

Module Usage

Too add additional fields: * Create a DataExtension that gets applied to GlobalContent * The extension requires an updateCMSFields(FieldList $fields) method and any standard DataExtension properties, (*5)

class GlobalContentExtension extends DataExtension 
{

    protected static $db = [
        'MyFieldName' => 'Varchar'
    ];

    public function updateCMSFields(FieldList $fields)
    {

        $fields->addFieldToTab(
            'Root.Main', 
            TextField::create('MyFieldName', 'My field name')
        );

    }

}

The use with permissions: * Grant the user/role/group the Access to 'Global Content' section permission, (*6)

To use in templates: * $GlobalContent.MyFieldName * <% with $GlobalContent %> {$MyFieldName} <% end_with %> * $GlobalContent('MyFieldName'), (*7)

To use in PHP: * GlobalContent::inst()->MyFieldName, (*8)

To alter the edit form directly: * Create a new LeftAndMainExtension that gets applied to GlobalContentAdmin * The extension can use the updateEditForm($form) method to update the form before data is loaded. * The extension can use the updateEditFormData($form) method to update the form after data is loaded., (*9)

The Versions

16/05 2017

dev-master

9999999-dev

Silverstripe SiteConfig like interface for global content that content-authors can access

  Sources   Download

MIT

The Requires

 

by Matthew Hailwood

silverstripe global webfox

19/01 2017

v1.1.1

1.1.1.0

Silverstripe SiteConfig like interface for global content that content-authors can access

  Sources   Download

MIT

The Requires

 

by Matthew Hailwood

silverstripe global webfox

16/11 2016

v1.1.0

1.1.0.0

Silverstripe SiteConfig like interface for global content that content-authors can access

  Sources   Download

MIT

The Requires

 

by Matthew Hailwood

silverstripe global webfox

26/02 2016

1.0.2

1.0.2.0

Silverstripe SiteConfig like interface for global content that content-authors can access

  Sources   Download

MIT

The Requires

 

by Matthew Hailwood

silverstripe global webfox

24/02 2016

1.0.1

1.0.1.0

Silverstripe SiteConfig like interface for global content that content-authors can access

  Sources   Download

MIT

The Requires

 

by Matthew Hailwood

silverstripe global webfox

24/02 2016

1.0.0

1.0.0.0

Silverstripe SiteConfig like interface for global content that content-authors can access

  Sources   Download

MIT

The Requires

 

by Matthew Hailwood

silverstripe global webfox