Creating an image gallery
This page is a placeholder.
Table of contents
Introduction
[TBA]
Colorbox
The project Colorbox is a Drupal bridge module
for colorbox
jQuery library by Jack Moore. The page links to some nice demos.
These are included in the library in the directories example1-5
.
The module is not able to use composer to install the library, see DO isuue: Discover colorbox library when installed with composer for details.
First install the Libraries module. Then use
drush to download and install the library and place it in the
directory /web/libraries
below your site's webroot.
$ composer require 'drupal/libraries:^3.0@beta' $ drush colorbox-plugin
Install the colorbox bridge module:
$ composer require 'drupal/colorbox:^1.8'
To install the library, do the following:
- Download
colorbox-master.zip
from the library home page. - Copy
colorbox-master.zip
into this directory. - Unzip the file.
- Rename the library directory from
colorbox-master
tocolorbox
. - Check the site's Status report to see that the colorbox library is installed.
Tutorial: OSTraining.
Step #1: Create a content type and content
Start out by creating a content-type "Gallery" which has a field "image" with an unlimited number of images.
Create a Image field that is attached to your new content type. Also, because this is just going to be a gallery, I removed the Body field from this content type.
Step #4:
- Go to Structure » Views » Add new view.
- Select your new content type and choose the "Gallery" content type.
- Choose you output your view as a page, not block.
- Choose an 'unformatted list'.
- Choose to show 'fields'.
- Add the Field for the image.
- Press Format » Settings.
- Set "Row class" to "col-sm-4" [image].
The name you give the view is reproduced in the CSS.
Juicebox
First install the Libraries module. Then use
drush to download and install the library.
the directory /web/libraries
below your site's webroot
(unless this has been done before).
$ composer require 'drupal/libraries:^3.0@beta' $ cd web $ mkdir libraries
$ composer require 'drupal/libraries:^3.0@beta'
Final word
[TBA]
Last update: 2022-02-18.