jordanvector / charcoal-cms

Charcoal Content Management System (CMS) Module

Home Page:http://charcoal.locomotive.ca

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Charcoal CMS

The CMS Charcoal Module (Content Management System). Provides basic objects to build a website. Notably, Section (or page), News, Event and Faq as well as to ather user data, notably ContactInquiry.

This module is heavily dependant on charcoal-object (and therefore charcoal-core) which provides the base Content and UserData classes the CMS objects are dependant on.

How to install

The preferred (and only supported) way of installing charcoal-cms is with composer:

★ composer require locomotivemtl/charcoal-cms

For a complete, ready-to-use project, start from the boilerplate:

★ composer create-project locomotivemtl/charcoal-project-boilerplate:@dev --prefer-source

Dependencies

Recommended dependencies

Objects

All objects in the charcoal-cms module implements \Charcoal\Object\Content, which allows to store creation & modification dates. Many objects also implement the \Charcoal\Object\PublishableInterface.

Core objects

Section object

A section, in Charcoal, is a reachable page on the website, as part of the full hierarchical site map. They can be displayed in menus or breadcrumbs and be reached with a unique URL (routable).

Types of sections:

  • blocks
    • Blocks sections define their content as a structured map of blocks.
  • content
    • Content sections define their content in a single, simple HTML property.
  • empty
    • Empty sections are linked to a template but do not require any custom content.
  • external
    • External sections are simply a redirect to an external (or internal) URL.

All section types, except external, make use of a Template object to be rendered. Typically, a charcoal view make sure of linking the template (by default, mustache

Sections are standard Charcoal Model, meaning they are describable with a Metadata object (which define a map of properties) and storable with a Source object.

Base section properties:

Name L10n Type Description
title string
subtitle html
template_ident string
template_options structure
attachments multi-object

Extra blocks properties:

Name L10n Type Description
blocks structure

Extra content properties:

Name L10n Type Description
content html

Extra external properties:

Name L10n Type Description
external_url url

Note that external sections ignore the template_ident & template_options properties as well as the metatags set of properties.

--

Because sections extends \Charcoal\Object\Content, they also have the following standard properties:

Name L10n Type Description
id1
active
position
created
created_by
last_modified
last_modified_by

[1] By default, the key of the section is the id..

--

Sections are hierarchical. They can be indented inside one another to create multi-dimensional site maps. The additional properties are therefore available:

Name L10n Type Description
master

The hierarchical interface (\Charcoal\Object\HierarchicalInterface) also provide the following methods, amongst others:

  • hierarchy()
  • children()
  • siblings()

--

Sections have metatags.

Name L10n Type Description
meta_title string
meta_description text
meta_image image
meta_author string

...and more specialized properties, for facebook / opengraph.

__

Like all Content objects, sections implement the \Charcoal\Object\RevisionableInterface, which tracks all save / update into revisions.

Extending the section object

The \Charcoal\Cms\Section\* objects are final. To extend, use the \Charcoal\Cms\AbstractSection base object instead, to make sure no metadata conflicts arise.

CMS objects

Event object

FAQ object

News object

Development

To install the development environment:

$ composer install --prefer-source

API documentation

Development dependencies

  • phpunit/phpunit
  • squizlabs/php_codesniffer
  • satooshi/php-coveralls

Continuous Integration

Service Badge Description
Travis Build Status Runs code sniff check and unit tests. Auto-generates API documentation.
Scrutinizer Scrutinizer Code Quality Code quality checker. Also validates API documentation quality.
Coveralls Coverage Status Unit Tests code coverage.
Sensiolabs SensioLabsInsight Another code quality checker, focused on PHP.

Coding Style

The Charcoal-App module follows the Charcoal coding-style:

Coding style validation / enforcement can be performed with composer phpcs. An auto-fixer is also available with composer phpcbf.

Authors

Changelog

Unreleased

License

The MIT License (MIT)

Copyright © Locomotive inc.

See Authors.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

Charcoal Content Management System (CMS) Module

http://charcoal.locomotive.ca


Languages

Language:PHP 98.9%Language:Shell 1.1%