dynamic/silverstripe-carousel
Composer 安装命令:
composer require dynamic/silverstripe-carousel
包简介
A simple carousel for Silverstripe websites.
关键字:
README 文档
README
A versatile carousel module for Silverstripe websites, featuring support for images and videos. The default template utilizes Bootstrap classes for seamless integration.
Table of Contents
- Requirements
- Installation
- Configuration
- Usage
- Customization
- Other Modules Using Silverstripe Carousel
- Maintainers
- Bugtracker
- Development and Contribution
- License
Requirements
- PHP: ^8.3
- silverstripe/recipe-cms: ^6
- fromholdio/silverstripe-embedfield: ^5.1
- jonom/focuspoint: ^6
- silverstripe/linkfield: ^5
- symbiote/silverstripe-gridfieldextensions: ^5
- unclecheese/display-logic: ^4.0
Installation
composer require dynamic/silverstripe-carousel
Features
- Multi-format Slides: Support for both image and video slides in a single carousel
- Image Management: Integration with Jonom FocusPoint for smart image cropping and focal points
- Video Embedding: Embed videos from YouTube, Vimeo, and other platforms via EmbedField
- Link Integration: Use SilverStripe LinkField for flexible slide linking (pages, URLs, files, email)
- Customizable Display: Configure autoplay, interval timing, pause on hover, and show/hide indicators
- Bootstrap 5 Templates: Default templates using Bootstrap 5 carousel component for responsive design
- Drag-to-Reorder: Easy slide management with GridField OrderableRows
- Page Extension: Simple integration via
CarouselPageExtensionfor any page type
Configuration
Apply the CarouselPageExtension to your desired page types in your YAML configuration:
Page: extensions: - Dynamic\Carousel\Extension\CarouselPageExtension
After applying the extension, run a dev/build to update the database schema.
Usage
Adding a Carousel to a Page
To display the carousel, include the following template in your page layout:
<% include Dynamic/Carousel/Includes/Carousel %>
Ensure that your template has access to the $Carousel variable, which contains the carousel data.
Working with Images and Videos
The module supports two types of content:
- Images: For displaying images.
- Videos: For embedding videos.
To add these:
- In the CMS, navigate to the page where you have enabled the carousel.
- Click on the "Carousel" tab.
- Use the "Add Slide" button to add either an Image or Video.
- For Images:
- Upload or select an image from the files.
- Optionally, add a caption or link.
- For Videos:
- Provide the video URL (supports platforms like YouTube and Vimeo).
- Optionally, add a caption.
Repeat these steps to add multiple images or videos as needed.
Customization
Creating Custom Templates
If you are not using Bootstrap or wish to customize the carousel appearance:
-
Locate the Default Template
The default template is located at:templates/Dynamic/Carousel/Includes/Carousel.ss -
Copy to Your Theme
Copy theCarousel.ssfile to your theme directory, maintaining the folder structure:themes/your-theme/templates/Dynamic/Carousel/Includes/Carousel.ss -
Modify the Template
Edit the copiedCarousel.ssto fit your design requirements. You can:- Change the HTML structure
- Update CSS classes
- Add or remove elements as needed
-
Include Necessary Assets
Ensure that any required JavaScript or CSS for your custom carousel implementation is included in your project.
If you are using a different frontend framework, include its assets accordingly.
For more information on custom templates, refer to the Silverstripe CMS Documentation.
Other Modules Using Silverstripe Carousel
The Silverstripe Carousel module is used in other projects to extend functionality, such as:
- Silverstripe Elemental Carousel - Integrates carousel functionality with Silverstripe Elemental Blocks.
Upgrading from version 2
Silverstripe Carousel 3.0 is compatible with SilverStripe 6. Key changes:
- Updated to SilverStripe CMS 6
- Requires PHP 8.3 or higher
- Updated LinkField from ^4 to ^5
- Updated FocusPoint from ^5 to ^6
- Updated EmbedField: migrated from
nathancox/embedfieldtofromholdio/silverstripe-embedfield(SS6 compatible fork) - Updated GridField Extensions from ^4 to ^5
- Updated Display Logic from ^3 to ^4
See the SilverStripe 6 Upgrade Guide for more details.
Maintainers
Bugtracker
Bugs are tracked in the issues section of this repository. Before submitting an issue please read over existing issues to ensure yours is unique.
If the issue does look like a new bug:
- Create a new issue
- Describe the steps required to reproduce your issue, and the expected outcome. Unit tests, screenshots and screencasts can help here.
- Describe your environment as detailed as possible: SilverStripe version, Browser, PHP version, Operating System, any installed SilverStripe modules.
Please report security issues to the module maintainers directly. Please don't file security issues in the bugtracker.
Development and Contribution
If you would like to make contributions to the module please ensure you raise a pull request and discuss with the module maintainers.
License
See License
dynamic/silverstripe-carousel 适用场景与选型建议
dynamic/silverstripe-carousel 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 14.82k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2023 年 09 月 06 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「cms」 「silverstripe」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 dynamic/silverstripe-carousel 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 dynamic/silverstripe-carousel 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 dynamic/silverstripe-carousel 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
GraphQL authentication for your headless Craft CMS applications.
Set Links with a specific language parameter
Supercharged text field validation.
Analytics chooser extensions for site settings.
Integrate with Snipcart.
统计信息
- 总下载量: 14.82k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 28
- 依赖项目数: 2
- 推荐数: 1
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2023-09-06