#1220698 by tpfeiffer: Theme image title via CSS
[project/hover_preview.git] / README.txt
1 Hover Preview for ImageCache
2 ============================
3
4 Requires Drupal 6.x, Imagefield, ImageCache, and Content modules.
5
6 This module provides a new series of ImageCache formatters. The overall goal
7 is to enable the ability to provide a hover state of an image when a mouse
8 rolls over it. This is similar to functionality you would find on many
9 shopping websites.
10
11 The implementation of this module goes a bit further than just a javascript
12 hover. The idea is you create multiple imagecache presets, and this will allow
13 you to hover from any preset to any other preset.
14
15 Here's a step-by-step of how to use it.
16
17 1) Create at least two imagecache presets, one for your thumbnail/static/small
18 image, and one for your larger hover image. You can create as many presets as
19 you like, but for this example we'll use two.
20
21 Preset #1 = Thumbnail = Scale and Crop, size of 80x80
22 Preset #2 = BigImage = Scale and Crop, size of 200x200
23
24 2) After saving your presets, you now have new choices available for the field
25 output. Let's say I am using views, and I created a view that outputs an
26 imagefield. I can now open the view, click on that field, and head down to the
27 'format' section. You have new options available to you, such as:
28
29 Hover: Thumbnail TO: BigImage
30 Hover: BigImage TO: Hover
31
32 The item on the left is the static image size to output, and the item on the
33 right is the hover state.
34
35 3) You can also manually output this at the theme layer with a statement
36 similar to the following. I am assuming you opened a file such as
37 node-mynodetype.tpl.php.
38
39 <?php
40   print theme('hover_preview', $node, 'field_mycckfieldname', 'Thumbnail',
41         'BigImage');
42 ?>
43
44 In this case, field_mycckfieldname is the name of your CCK field, Thumbnail is
45 the name of the source imagecache preset, and BigImage is the hover state.
46
47
48 IMPORTANT NOTE: If you have a lot of imagecache presets, you are going to have a huge
49 number of formatters. This is due to the fact that the module maps ALL presets
50 to ALL other presets.