承接 nzta/gallery 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

nzta/gallery

最新稳定版本:2.1.0

Composer 安装命令:

composer require nzta/gallery

包简介

A module for creating a gallery of images with captions

README 文档

README

Provides the ability add a Gallery to any number of page types to provide a gallery of images with captions

Requirements

SilverStripe 4.x or 5.x

Features

  • Able to create a set of GalleryItems that each consist of an image and a caption
  • Define which PageTypes these GalleryItems should be added to through extensions configurations
  • When a galleryitem is clicked on, a lightbox popup shows with carousel functionality

Installation

composer require nzta/gallery

Installing assets

You will need to require in the Requirements::javascript('nzta/gallery: js/gallery.js') in order to display the gallery out of the box and have the lightbox functionality.

There is also a Requirements::css('nzta/gallery: css/main.css) file that can be used to display basic styles for the CarouselModal.

Setting up templates

Once you have the assets being pulled in, you will need to add the gallery to the template, e.g. <% include Gallery %>

You will also need the __galleryData available globally for the JS to work. You can add the following to your <head>:

<script>
    window.__galleryData = {
      items: {$GalleryData}
    }
</script>

Adding the extensions

Now you can add the GalleryExtension to any page type you want to provide a gallery to, e.g.

Page:
  extensions:
    - NZTA\Gallery\Extensions\GalleryExtension

This will provide the CMS fields to add gallery images to the page.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2018-10-15