承接 pstaender/silverstripe-photogallerypage 相关项目开发

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

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

pstaender/silverstripe-photogallerypage

最新稳定版本:v1.2.1

Composer 安装命令:

composer require pstaender/silverstripe-photogallerypage

包简介

Adds a page type to manage multiple images including description and other various options

README 文档

README

Adds a page type to manage multiple images including description and other various options

The following SiteTree page type will be added:

  • GalleryPage / GalleryPageController
  • GalleryPageHolder
  • GalleryPicture

Requirements

  • SilverStripe 4+ (use v0.6.1 for SilverStripe 3.x)

Installation

  $ composer require pstaender/silverstripe-photogallerypage

Don't forget to run a dev/build?flush=all after installing.

Methods and Behaviour

All Pictures will be available through SortedPictures, with + for ascending (default) and - for descending. All Pictures are also available as URL. Let's assume the URL of your GalleryPage is http://localhost/photos and (an arbitary) image has the URLSegment example-picture, it will be available as http://localhost/photos/example-picture. This behaviour can be be switched on/off with picturesAccessibleViaURL in your config.

Usage in Template

Your Layout/GalleryPage.ss could be for instance:

<article class="gallery">
  <h1>$Title</h1>
  <% with CurrentPicture %>
    <h2>Selected Picture</h2>
    $Image.ScaleHeight(200)
    <br />
    <span class="previousPicture">
      <% with Previous %>
        <a href="$Link">« $Image.ScaleHeight(100)</a>
      <% end_with %>
    </span>
    <span class="nextPicture">
      <% with Next %>
        <a href="$Link">$Image.ScaleHeight(100) » </a>
      <% end_with %>
    </span>
  <% end_with %>

  <br />

  <h3>All Pictures</h3>
  <% loop SortedPictures %>
    <a href="$Link" class="$LinkingMode">
      $ImagePreview
      <% if LinkingMode == 'current' %>selected<% end_if %>
    </a>
  <% end_loop %>
</article>

Configuration

See in _config/photogallerypage.yml what possible configuration attributes are available for you to overwrite.

Copyright and License

This project is under GNU General Public License v2

Icons by Freepik (http://www.flaticon.com/packs/web-design-2)

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: GPL-2.0-only
  • 更新时间: 2015-11-06