NodeImageBlock lightbox2 compatibility

levavie - May 23, 2008 - 14:12
Project:Node Image Block
Version:5.x-2.1
Component:Code
Category:task
Priority:normal
Assigned:Unassigned
Status:needs work
Description

Please add lightbox2 compatibility as a standard flag configuration flag.

I've currently succeeded in creating such compatibility with a simple change to nodeimageblock.tpl.php:

<div id="nodeimageblock">
<?php foreach ($images as $img) { ?>
  <div>
    <a href='<?=$img->path ?>' class='thumbnail' rel='lightbox'><img src="<? echo $img->src ?>" alt="<? echo $img->desc ?>" title="<? echo $img->desc ?>" /></a>
    <p><? echo $img->desc ?></p>
  </div>
<?php } ?>
</div>

Usage: Install nodeimageblock and lightbox modules, then put the code in nodeimageblock.tpl.php in your theme's image directory. This enables the user to zoom on the thumbnails displayed by the attached images block exposed by this module.

Amnon
-
Professional: Drupal Israel | Drupal Development & Consulting | Eco-Healing
Personal: Hitech Dolphin: Regain Simple Joy :)

#1

levavie - May 23, 2008 - 15:23

Also, if we want description to appear on the lightbox2 popoup window, below the picture, we should populate the title attribute:

<div id="nodeimageblock">
<?php foreach ($images as $img) { ?>
  <div>
    <a href='<?=$img->path ?>' class='thumbnail' rel='lightbox' title='<?=$img->desc ?>'><img src="<? echo $img->src ?>" alt="<? echo $img->desc ?>" title="<? echo $img->desc ?>" /></a>
    <p><? echo $img->desc ?></p>
  </div>
<?php } ?>
</div>

Here is a patch file

AttachmentSize
nodeimageblock.tpl_.php_.patch.txt 760 bytes
 
 

Drupal is a registered trademark of Dries Buytaert.