定制 kreationsbyran/kb-slideshow 二次开发

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

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

kreationsbyran/kb-slideshow

最新稳定版本:1.1.0

Composer 安装命令:

composer require kreationsbyran/kb-slideshow

包简介

Simple slideshow module

README 文档

README

Latest Stable Version License

Slideshow module for SilverStripe 3.1 that implements back-end support for slideshows/carousels/sliders. For the sake of demonstration it comes with an plug-and-play example using slick. It can easily be removed without disrupting functionality. More about this further down under the slick heading.

Installation

As a general rule of thumb it can be a good idea to back up your database and log into your site as Admin before installing modules, so even though nothing should break, feel free to do so.

Requirements
  • SilverStripe 3.1
Using Composer
  1. Open a terminal and cd to your SilverStripe root.
  2. Run composer require kreationsbyran/kb-slideshow.
  3. Go to http://your.site/dev/build?flush=all (replace "your.site" with the url of your website)
Manually
  1. Download the zipped master branch (here).
  2. Move the contents into the root directory of your SilverStripe installation.
  3. Go to http://your.site/dev/build?flush=all (replace "your.site" with the url of your website)
Additionally (optional)

KBSlideshow works well together with SortableGridField which allows for drag-and-drop sorting of the slides.

Usage

In Template

Using <% include KBSlideshow %> in your SilverStripe template will include the default template. You can easily replace or edit this template.

/templates/includes/KBSlideshow.ss markup ouput

├──div.kbslideshow (if exists)
|  └──div.kbslide  (loop)
|     ├──img       (if exists)
|     ├──h1        (if exists)
|     └──p         (if exists)
In CMS

The module extends Page and once installed it will create a tab called "Slideshow" in the CMS of all Pages.

"Image rescale width/height" will set the ratio of all slides to width:height if both options are set. If only one is set, the images will be cropped using SilverStripes Image.SetWidth() or Image.SetHeight() functions. If none are set the selected image won't be rescaled or cropped and can result in heavy load. Recommended to set at least one if slideshow contains images.

Slick

The module comes bundled with a demonstration using slick. To remove the coupling between the module and slick in order to use a different slideshow/slider/carousel library, simply follow these two steps:

  1. Remove /templates/includes/KBSlick.ss.
  2. Remove <% include KBSlick %> from /templates/includes/KBSlideshow.ss.
Settings

If you wish to keep using slick, you'll find the settings located in /templates/includes/KBSlick.ss. There is currently no back-end support for managing slick settings but can easily be added by modifying the KBSlideshow class.

License

Copyright (c) 2015 Kreationsbyrån Sverige AB

Licensed under the MIT License

统计信息

  • 总下载量: 140
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-09-04