Project

General

Profile

Paste
Download (10.8 KB) Statistics
| Branch: | Revision:

root / drupal7 / sites / all / modules / lightbox2 / README.txt @ 6135231a

1
CONTENTS OF THIS FILE
2
----------------------
3

    
4
  * Introduction
5
  * Installation
6
  * Adding Lightbox Functionality to your Images
7
    - No Grouping
8
    - With Grouping
9
    - Slideshow
10
    - Video
11
    - HTML Content Support
12
    - Inline Content Support
13
    - Turning the Image Caption into a Link
14
  * Keyboard Shortcuts
15
  * Translation of Configured Strings
16
  * Known Issues
17
    - Keyboard Shortcuts in Opera
18

    
19

    
20
INTRODUCTION
21
------------
22
Maintainers:
23
  Stella Power (http://drupal.org/user/66894)
24
  Daniel F. Kudwien (http://drupal.org/user/54136)
25
  Mark Ashmead (http://drupal.org/user/52392)
26
  Fernando Correa da Conceição (http://drupal.org/user/889254)
27

    
28
Documentation: http://drupal.org/node/144469
29

    
30
Licensed under the GNU/GPL License
31
Based on Lightbox v2.03.3 by Lokesh Dhakar
32
<http://www.huddletogether.com/projects/lightbox2/>
33

    
34
Originally written to make use of the Prototype framework, and Script.acalo.us,
35
now altered to use jQuery.
36

    
37
Permission has been granted to Mark Ashmead & other Drupal Lightbox2 module
38
maintainers to distribute the original lightbox.js via Drupal.org under this
39
license scheme.  This file has been subsequently modified to make use of jQuery
40
instead of prototype / script.acalo.us.
41

    
42
This module enables the use of lightbox2 which places images above your
43
current page, not within. This frees you from the constraints of the layout,
44
particularly column widths.
45

    
46
This module will include the lightbox CSS and JS files in your Drupal
47
Installation without the need to edit the theme. The module comes with a
48
Lightbox2 Lite option which does not use the jQuery libraries; it is therefore
49
less likely to conflict with anything else.
50

    
51

    
52
INSTALLATION
53
------------
54
1. Copy lightbox2 folder to modules directory.
55
2. At admin/modules enable the lightbox2 module.
56
3. Enable permissions at admin/people/permissions.
57
4. Configure the module at admin/config/user-interface/lightbox2.
58
5. Modify your image links to open in a lightbox where necessary, see "Adding
59
   Lightbox Functionality to your Images' section below.
60
6. If you need to play flv files, then you may need to install a FLV player.
61
   There are a number of freely available ones on the Internet, including
62
   http://www.jeroenwijering.com/
63

    
64

    
65
ADDING LIGHTBOX FUNCTIONALITY TO YOUR IMAGES
66
--------------------------------------------
67
No Grouping
68
===========
69
Add rel="lightbox" attribute to any link tag to activate the lightbox.
70
For example:
71
<a href="images/image-1.jpg" rel="lightbox">image #1</a>
72
<a href="images/image-1.jpg" rel="lightbox[][my caption]">image #1</a>
73

    
74
Optional: To show a caption either use the title attribute or put in the second
75
set of [] of the rel attribute.
76

    
77
With Grouping
78
==============
79
If you have a set of related images that you would like to group, follow step
80
one but additionally include a group name between square brackets in the rel
81
attribute. For example:
82

    
83
<a href="images/image-1.jpg" rel="lightbox[roadtrip]">image #1</a>
84
<a href="images/image-2.jpg" rel="lightbox[roadtrip][caption 2]">image #2</a>
85
<a href="images/image-3.jpg" rel="lightbox[roadtrip][caption 3]">image #3</a>
86

    
87
No limits to the number of image sets per page or how many images are allowed
88
in each set. Go nuts!
89

    
90
If you have a set of images that you would like to group together in a
91
lightbox, but only wish for one of these images to be visible on your page, you
92
can assign the "lightbox_hide_image" class to hide the additional images.  For
93
example:
94

    
95
<a href="images/image-1.jpg" rel="lightbox[roadtrip]">image #1</a>
96
<a href="images/image-2.jpg" rel="lightbox[roadtrip]" class="lightbox_hide_image">image #2</a>
97
<a href="images/image-3.jpg" rel="lightbox[roadtrip]" class="lightbox_hide_image">image #3</a>
98

    
99
Slideshow
100
=========
101
This is very similar to the grouping functionality described above.  The only
102
difference is that "rel" attribute should be set to "lightshow" instead of
103
"lightbox".  Using the same example as above, we could launch the images in a
104
slideshow by doing:
105

    
106
<a href="images/image-1.jpg" rel="lightshow[roadtrip]">image #1</a>
107
<a href="images/image-2.jpg" rel="lightshow[roadtrip][caption 2]">image #2</a>
108
<a href="images/image-3.jpg" rel="lightshow[roadtrip][caption 3]">image #3</a>
109

    
110
Video
111
=====
112
It's possible to show video content in the lightbox.  In this case the "rel"
113
attribute should be set to "lightvideo".  It's possible to group videos and 
114
to control the size of the lightbox by setting the 'width' and 'height
115
properties.  The properties can be configured like
116
"lightvideo[group|width:300px; height: 200px;]" and
117
"lightvideo[|width:300px; height: 200px;][my caption]".  The properties should
118
all be of the format "property: value;" - note the closing semi-colon.  If no
119
properties are set, then the default width and height of 400px will be used.
120
See below for more detailed examples.
121

    
122
Basic example:
123
<a href="http://video.google.com/videoplay?docid=1811233136844420765"
124
rel="lightvideo">Google video example - default size</a>
125

    
126
Basic example with caption:
127
<a href="http://video.google.com/videoplay?docid=1811233136844420765"
128
rel="lightvideo[][my caption]">Google video example - default size</a>
129

    
130
Grouped example:
131
<a href="http://video.google.com/videoplay?docid=29023498723974239479"
132
rel="lightvideo[group][caption 1]">Grouped example 1</a>
133
<a href="http://video.google.com/videoplay?docid=1811233136844420765"
134
rel="lightvideo[group][caption 2]">Grouped example 2</a>
135

    
136
Controlling lightbox size example:
137
<a href="http://video.google.com/videoplay?docid=1811233136844420765"
138
rel="lightvideo[|width:400px; height:300px;][my caption]">Google video example -
139
custom size</a>
140

    
141
Supported Video Formats
142
asx, wmv, mov and swf videos should all be supported.  A number of video
143
providers are also supported, for example YouTube and Google Video. For full
144
details on how to integrate these with lightbox, please see the online
145
documentation.
146

    
147
HTML Content Support
148
====================
149
It's possible to show webpage content in the lightbox, using iframes.  In this
150
case the "rel" attribute should be set to "lightframe".  Again it's possible to
151
group the content, (e.g. "lightframe[search]") but in addition to that, it's
152
possible to control some of the iframe properties.  It's possible to set the
153
'width', 'height' and 'scrolling' properties of the iframe.  The properties are
154
separated from the group name by a '|', for example
155
"lightframe[search|width:100px;]" and
156
"lightframe[search|width:100px;][my caption]".  If no grouping is being used,
157
then the '|' is still used and the format would be "lightframe[|width:100px;]".
158
The properties should all be of the format "property: value;" - note the closing
159
semi-colon.  If no iframe properties are set, then the default width and height
160
of 400px will be used. See below for more detailed examples.
161

    
162
Basic example:
163
<a href="http://www.google.com" rel="lightframe">Search google</a>
164

    
165
Basic example with caption:
166
<a href="http://www.google.com" rel="lightframe[][my caption]">Search google</a>
167

    
168
Grouped example:
169
<a href="http://www.google.com" rel="lightframe[search]">Search google</a>
170
<a href="http://www.yahoo.com" rel="lightframe[search][Search Yahoo]">Search yahoo</a>
171

    
172
Controlling iframe property example:
173
<a href="http://www.google.com" rel="lightframe[|width:400px; height:300px; scrolling: auto;]">Search google</a>
174

    
175
Controlling iframe property when grouped example:
176
<a href="http://www.google.com" rel="lightframe[search|width:400px; height:300px; scrolling: auto;][Search Google]">Search google</a>
177
<a href="http://www.yahoo.com" rel="lightframe[search|width:400px; height:300px;]">Search yahoo</a>
178
<a href="http://www.yahoo.com" rel="lightframe[search|width:400px; height:300px;][Search Yahoo]">Search yahoo</a>
179

    
180
Inline Content Support
181
=======================
182
It's possible to show HTML snippets in the lightbox, that is on the same domain.
183
In this case the "rel" attribute should be set to "lightmodal".  Again it's
184
possible to group the content, (e.g. "lightmodal[search]") but in addition to
185
that, it's possible to control some of the inline / modal properties.  It's
186
possible to set the 'width', 'height' and 'scrolling' properties of the inline
187
content.  The properties are separated from the group name by a '|', for example
188
"lightmodal[search|width:100px;]" and
189
"lightmodal[search|width:100px;][my caption]".  If no grouping is being used,
190
then the '|' is still used and the format would be "lightmodal[|width:100px;]".
191
The properties should all be of the format "property: value;" - note the closing
192
semi-colon.  If no properties are set, then the default width and height of
193
400px will be used. See below for more detailed examples.
194

    
195
Basic example:
196
<a href="search.php" rel="lightmodal">Search</a>
197

    
198
Basic example with caption:
199
<a href="search.php" rel="lightmodal[][my caption]">Search</a>
200

    
201
Grouped example:
202
<a href="search.php" rel="lightmodal[search]">Search</a>
203
<a href="search.php?status=1" rel="lightmodal[search][published]">Search published content</a>
204

    
205
Controlling modal property example:
206
<a href="search.php" rel="lightmodal[|width:400px; height:300px; scrolling: auto;]">Search</a>
207

    
208
Controlling modal property when grouped example:
209
<a href="search.php" rel="lightmodal[search|width:400px; height:300px; scrolling: auto;]">Search</a>
210
<a href="search.php?status=1" rel="lightmodal[search|width:400px; height:300px;][Search published]">Search published content</a>
211
<a href="search.php?status=0" rel="lightmodal[search|width:400px; height:300px;][Search Unpublished]">Search unpublished content</a>
212

    
213

    
214

    
215
Turning the Image Caption into a Link
216
=====================================
217
If you wish to turn the caption into a link, format your caption in the
218
following way:
219

    
220
<a href="images/image-1.jpg" rel="lightbox[][&lt;a href=\"http://www.yourlink.com\"&gt;Clicky Visit Link&lt;/a&gt;'>image #1</a>
221

    
222
Note, the < and > characters have been changed to their HTML entities, and the "
223
have been escaped.
224

    
225

    
226
KEYBOARD SHORTCUTS
227
------------------
228
Not all of the default keyboard shortcuts work in the Opera browser, for example
229
'z' for toggling the zoom and 'spacebar' for toggling play / pause in
230
slideshows.  This can be overcome by updating your shortcut settings in the
231
Opera preferences editor.
232

    
233
The default keyboard shortcuts are listed below.  You can override these on
234
admin/settings/lightbox2.
235

    
236
Close : x, o, c, ESC
237
Previous Image : p, Left Arrow
238
Next Image : n, Right Arrow
239
Toggle Zoom : z (not available in slideshow)
240
Toggle Play / Pause : Spacebar (slideshow only)
241

    
242

    
243
TRANSLATION OF CONFIGURED STRINGS
244
----------------------------------
245
In order to translate the lightbox2 configuration strings, such as the text for
246
the "View Image Details" link and the image count, please install the i18n:
247
internationalization module and follow the instructions at 
248
http://drupal.org/node/134002.
249

    
250

    
251
KNOWN ISSUES
252
------------
253

    
254
Keyboard Shortcuts in Opera
255
---------------------------
256
Not all of the default keyboard shortcuts work in the Opera browser, for example
257
'z' for toggling the zoom and 'spacebar' for toggling play / pause in
258
slideshows.  This can be overcome by updating your shortcut settings in the
259
Opera preferences editor.