fractas/elemental-stylings
Composer 安装命令:
composer require fractas/elemental-stylings
包简介
Collection of useful and reusable SilverStripe Elemental stylings properties
README 文档
README
Introduction
This module extends a SilverStripe Elemental Blocks to enhance its functionalities with predefined sets of Classes of Styling elements.
Predefined Styling classes:
- StylingHeight - changes a height of a Block
- StylingHorizontalAlign - changes a horizontal alignment of a Block
- StylingLimit - changes a limit of a Block
- StylingSize - changes a size of a Block
- StylingStyle (extended from Core module) - special enhancements for a class extended from Core module
- StylingTextAlign - changes a text alignment inside of a Block
- StylingVerticalAlign - changes a vertical alignment of a Block
- StylingWidth - changes a width of a Block (example uses Bootstrap Grid syntax)
The module provides basic markup for each of the stylings but you have an option to edit and/or replace those predefined styles.
Requirements
- SilverStripe CMS ^6.0
- SilverStripe Elemental Blocks ^6.0
For CMS 4.x and 5.x use version 1.x of this module.
Installation
- Install a module via Composer
composer require fractas/elemental-stylings
- Follow an instructions for installation of Elemental Blocks module
- Apply a desired Styling Class extension on Block class (ie. ElementContent that ships with Core module) mysite/_config/elements.yml
DNADesign\Elemental\Models\ElementContent: extensions: - Fractas\ElementalStylings\StylingHeight - Fractas\ElementalStylings\StylingHorizontalAlign - Fractas\ElementalStylings\StylingStyle - Fractas\ElementalStylings\StylingTextAlign - Fractas\ElementalStylings\StylingVerticalAlign - Fractas\ElementalStylings\StylingWidth
- Add an desired styles based on your preferences, see Configuration example
- Optionaly, you can require basic CSS stylings provided with this module to your controller class like:
mysite/code/PageController.php
Requirements::css('fractas/elemental-stylings:client/dist/css/stylings.css');
- Build and flush your project
vendor/bin/sake dev/build flush=1
Full configuration example
This is a sample configuration for use of Stylings classes in YML configuration.
mysite/_config/elements.yml
DNADesign\Elemental\Models\ElementContent: extensions: - Fractas\ElementalStylings\StylingHeight - Fractas\ElementalStylings\StylingHorizontalAlign - Fractas\ElementalStylings\StylingStyle - Fractas\ElementalStylings\StylingTextAlign - Fractas\ElementalStylings\StylingVerticalAlign - Fractas\ElementalStylings\StylingWidth styles: light: 'Light background color with Dark text' dark: 'Dark background color with White text' textalign: left: 'Left' right: 'Right' center: 'Center' horalign: left: 'Left' right: 'Right' center: 'Center' veralign: top: 'Top' middle: 'Middle' bottom: 'Bottom' height: small: 'Small' medium: 'Medium' large: 'Large' width: col-sm-6: '50%' col-sm-4: '33.33%' col-sm-12: '100%'
Implementation example: 'Text with Image' Element
- New Element class file: ElementContentImage.php
- New Element template file: ElementContentImage.ss
Screenshots
Updated GridField with preview of applied stylings:

Styling tab of a Block with icons for specific styles:

Reporting Issues
Please create an issue for any bugs you've found, or features you're missing.
License
See License
Credits
Styling icons from IcoMoon - Free by IcoMoon
fractas/elemental-stylings 适用场景与选型建议
fractas/elemental-stylings 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 16.5k 次下载、GitHub Stars 达 14, 最近一次更新时间为 2018 年 06 月 28 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「content management」 「silverstripe」 「Content Blocks」 「styling」 「elemental」 「silverstripe elemental」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 fractas/elemental-stylings 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 fractas/elemental-stylings 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 fractas/elemental-stylings 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A block that displays featured content - large image, title, description and link.
TYPO3 CMS extension to create gallery content element with preset crop ratios and pagination
Analytics chooser extensions for site settings.
A Silverstripe module to allow you to log into any of your Silverstripe sites from one place.
Task system for APPUI
统计信息
- 总下载量: 16.5k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 14
- 点击次数: 8
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2018-06-28