定制 locomotivemtl/charcoal-cms 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

locomotivemtl/charcoal-cms

Composer 安装命令:

composer require locomotivemtl/charcoal-cms

包简介

Charcoal CMS (Content Management System) Module

关键字:

README 文档

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

Recommended dependencies

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 a Metadata object (which define a map of properties) and storable with a Source object.

Base section properties:

Interface Name L10n Type Description
Section section_type choice
Section title string
Section subtitle html
Section summary html
Section image image
Section template_ident string
Section template_options structure
Section content html
Section attachments multi-object
Section external_url url For external URLs. Note that all content-related properties are ignored if this property is set.
Content id id The model's key.
Content active bool Inactive events should not appear in public API / frontend.
Content position int Default order property.
Authorable created_by string Admin user.
Authorable last_modified_by string Admin user.
Authorable required_acl_permissions array To do...
Timestampable created date-time
Timestampable last_modified date-time
Hierarchical master object SectionInterface.
Routable slug string Permalink. Auto-generated from title.

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:

Interface Name L10n Type Description
Event title string
Event subtitle html
Event summary html
Event content html
Event image image
Event start_date date-time
Event end_date date-time
Event info_url image
Content id id The model's key.
Content active bool Inactive events should not appear in public API / frontend.
Content position int Default order property.
Authorable created_by string Admin user.
Authorable last_modified_by string Admin user.
Authorable required_acl_permissions array To do...
Timestampable created date-time
Timestampable last_modified date-time
Categorizable category object EventCategory, or custom.
Publishable publishDate date-time
Publishable expiryDate date-time
Publishable publishStatus string draft, pending, or published.
Routable slug string Permalink. Auto-generated from title.
Metatag meta_title string
Metatag meta_description string
Metatag meta_image image
Metatag meta_author string
Templateable controller_ident string
Templateable template_ident string
Templateable template_options structure

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:

Interface Name L10n Type Description
News title string
News subtitle html
News summary html
News content html
News image image
News news_date date-time
News info_url image
Content id id The model's key.
Content active bool Inactive news should not appear in public API / frontend.
Content position int Default order property.
Authorable created_by string Admin user.
Authorable last_modified_by string Admin user.
Authorable required_acl_permissions array To do...
Timestampable created date-time
Timestampable last_modified date-time
Categorizable category object NewsCategory, or custom.
Publishable publishDate date-time
Publishable expiryDate date-time
Publishable publishStatus string draft, pending, or published.
Routable slug string Permalink. Auto-generated from title.
Metatag meta_title string
Metatag meta_description string
Metatag meta_image image
Metatag meta_author string
Templateable controller_ident string
Templateable template_ident string
Templateable template_options structure

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

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-cms 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

License

Charcoal is licensed under the MIT license. See LICENSE for details.

locomotivemtl/charcoal-cms 适用场景与选型建议

locomotivemtl/charcoal-cms 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 9.06k 次下载、GitHub Stars 达 52, 最近一次更新时间为 2015 年 11 月 12 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「cms」 「charcoal」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 locomotivemtl/charcoal-cms 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 locomotivemtl/charcoal-cms 我们能提供哪些服务?
定制开发 / 二次开发

基于 locomotivemtl/charcoal-cms 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 9.06k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 52
  • 点击次数: 7
  • 依赖项目数: 3
  • 推荐数: 0

GitHub 信息

  • Stars: 52
  • Watchers: 14
  • Forks: 8
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-11-12