locomotivemtl / charcoal-cms
Charcoal CMS (Content Management System) Module
Installs: 8 708
Dependents: 3
Suggesters: 0
Security: 0
Stars: 48
Watchers: 16
Forks: 5
Open Issues: 3
Requires
- php: >7.1
- locomotivemtl/charcoal-app: ~0.8
- locomotivemtl/charcoal-attachment: ~0.10
- locomotivemtl/charcoal-core: ~0.6
- locomotivemtl/charcoal-factory: ~0.4
- locomotivemtl/charcoal-object: ~0.7
- locomotivemtl/charcoal-property: ~0.10
- locomotivemtl/charcoal-translator: ~0.3
- psr/http-message: ^1.0
Requires (Dev)
- locomotivemtl/charcoal-admin: ~0.28
- mustache/mustache: ^2.11
- php-coveralls/php-coveralls: ^2.2
- phpunit/phpunit: ^7.5
- squizlabs/php_codesniffer: ^3.3
- tedivm/stash: ~0.14
Conflicts
- locomotivemtl/charcoal-admin: <0.28.0
- dev-master / 0.10.x-dev
- 0.10.0.3
- 0.10.0.2
- 0.10.0.1
- 0.10.0
- 0.9.7
- 0.9.6
- 0.9.5
- 0.9.4
- 0.9.3
- 0.9.2
- 0.9.1
- 0.9.0
- 0.8.6.4
- 0.8.6.3
- 0.8.6.2
- 0.8.6.1
- 0.8.6
- 0.8.5
- 0.8.4.1
- 0.8.4
- 0.8.3.1
- 0.8.3
- 0.8.2.1
- 0.8.2
- 0.8.1
- 0.8.0.3
- 0.8.0.2
- 0.8.0.1
- 0.8.0
- 0.7.0.1
- 0.7.0
- 0.6.0
- 0.5.2
- 0.5.1.1
- 0.5.1
- 0.5.0
- 0.4.6.1
- 0.4.6
- 0.4.5.1
- 0.4.5
- 0.4.4
- 0.4.3
- 0.4.2
- 0.4.1.2
- 0.4.1.1
- 0.4.1
- 0.4.0.2
- 0.4.0.1
- 0.4
- 0.3.8
- 0.3.7
- 0.3.6
- 0.3.5.1
- 0.3.5
- 0.3.4
- 0.3.3.2
- 0.3.3.1
- 0.3.3
- 0.3.2.4
- 0.3.2.3
- 0.3.2.2
- 0.3.2.1
- 0.3.2
- 0.3.1
- 0.3
- 0.2.1
- 0.2
- 0.1
- dev-feature/camelizePropertiesAndUseArrayAccess
- dev-mcaskill-patch-web-template
- dev-losted-patch-unit-tests
- dev-mducharme-admin-metadata
- dev-dlord-relation
This package is auto-updated.
Last update: 2024-08-30 02:13:29 UTC
README
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
class the CMS objects are dependant on, as well as many trait / interface behaviors.
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 charcoal project boilerplate
:
★ composer create-project locomotivemtl/charcoal-project-boilerplate:@dev --prefer-source
Dependencies
PHP 5.6+
- PHP 7 is recommended for security and performance reasons.
locomotivemtl/charcoal-attachment
- Content blocks are provided with attachments.
locomotivemtl/charcoal-core
- Core charcoal models and storage class.
- Provides base Model, which depends on Storable and Describable.
locomotivemtl/charcoal-object
- CMS objects are based on
\Charcoal\Object\Content
.
- CMS objects are based on
locomotivemtl/charcoal-translator
- Localization is provided by symfony translator (charcoal).
Recommended dependencies
locomotivemtl/charcoal-admin
- The backend (admin panel).
Objects
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 aMetadata
object (which define a map ofproperties
) and storable with aSource
object.
Base section properties:
Interfaces
From model:
Describable
: The objects can be defined by Metadata.Storable
: Objects have unique IDs and can be stored in storage / database.
From content:
Content
: A "managed" charcoal model (describable with metadata / storable).Authorable
: Creation and modification user (admin) are kept in the storage.Revisionable
: Copy of changes will be kept upon each object update in the storage.Timestampable
: Creation and modification time are kept into the storage.
From charcoal-object
Hierarchicale
: The objects can be stacked hierarchically.Publishable
: Objects have publish status, date and expiry. Allows moderation.Routable
: Objects are reachable through a URL.
From charcoal-cms:
Metatag
: The objects have meta-information for SEO purpose.Searchable
: Extra keywords can be used to help search engine.Templateable
: The objects can be rendered with a template / controller / config combo.
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.
Tag object
Tag objects link any objects together by providing an extra taxonomy layer. Tags may also be used to enhance internal search engines.
CMS objects
Event object
Charcoal Event is a specialized content object to describe an event, which typically happens at a given date in a certain location.
Base events properties:
Interfaces
From model:
Describable
: The objects can be defined by Metadata.Storable
: Objects have unique IDs and can be stored in storage / database.
From content:
Content
: A "managed" charcoal model (describable with metadata / storable).Authorable
: Creation and modification user (admin) are kept in the storage.Revisionable
: Copy of changes will be kept upon each object update in the storage.Timestampable
: Creation and modification time are kept into the storage.
From charcoal-object:
Categorizable
: The objects can be put into a category.Publishable
: Objects have publish status, date and expiry. Allows moderation.Routable
: Objects are reachable through a URL.
From charcoal-cms:
Metatag
: The objects have meta-information for SEO purpose.Searchable
: Extra keywords can be used to help search engine.Templateable
: The objects can be rendered with a template / controller / config combo.
Extending the event object
The \Charcoal\Cms\Event
object is final
. To extend, use the \Charcoal\Cms\AbstractEvent
base object instead, to make sure no metadata conflicts arise.
Event categories
Event category objects are simple charcoal/object/category
used to group / categorize events. The default type is Charcoal\Cms\EventCategory
.
Events implement the Categorizable
interface, from charcoal-object.
FAQ object
FAQ objects are a special content type that is split in a "question" / "answer" format.
FAQ categories
FAQ category objects are simple charcoal/object/category
used to group / categorize FAQ objects. The default type is Charcoal\Cms\FaqCategory
.
FAQs implement the Categorizable
interface, from charcoal-object.
News object
News object are a special content type that with a specific news date.
Base news properties:
Interfaces
From model:
Describable
: The objects can be defined by Metadata.Storable
: Objects have unique IDs and can be stored in storage / database.
From content:
Content
: A "managed" charcoal model (describable with metadata / storable).Authorable
: Creation and modification user (admin) are kept in the storage.Revisionable
: Copy of changes will be kept upon each object update in the storage.Timestampable
: Creation and modification time are kept into the storage.
From charcoal-object:
Categorizable
: The objects can be put into a category.Publishable
: Objects have publish status, date and expiry. Allows moderation.Routable
: Objects are reachable through a URL.
From charcoal-cms:
Metatag
: The objects have meta-information for SEO purpose.Searchable
: Extra keywords can be used to help search engine.Templateable
: The objects can be rendered with a template / controller / config combo.
Extending the news object
The \Charcoal\Cms\News
object is final
. To extend, use the \Charcoal\Cms\AbstractNews
base object instead, to make sure no metadata conflicts arise.
News categories
News category objects are simple charcoal/object/category
used to group / categorize events. The default type is Charcoal\Cms\NewsCategory
.
News implement the Categorizable
interface, from charcoal-object.
Development
To install the development environment:
$ composer install --prefer-source
API documentation
- The auto-generated
phpDocumentor
API documentation is available at https://locomotivemtl.github.io/charcoal-cms/docs/master/ - The auto-generated
apigen
API documentation is available at https://codedoc.pub/locomotivemtl/charcoal-cms/master/
Development dependencies
phpunit/phpunit
squizlabs/php_codesniffer
satooshi/php-coveralls
Continuous Integration
Coding Style
The charcoal-cms
module follows the Charcoal coding-style:
- PSR-1
- PSR-2
- PSR-4, autoloading is therefore provided by Composer.
- phpDocumentor comments.
- Read the phpcs.xml file for all the details on code style.
Coding style validation / enforcement can be performed with
composer phpcs
. An auto-fixer is also available withcomposer phpcbf
.
Authors
License
Charcoal is licensed under the MIT license. See LICENSE for details.