hi:

i have a cck field called field_image that i output like this:

<?php foreach ((array)$field_image as $item) { ?>
<?php print $item['view'] ?>
<?php } ?>

and it displays the full image i uploaded.
But i want to integrate it with the lightbox module like this:

<a href=" http://localhost/myimagefileaddress" rel="lightbox">Click here for Full Image</a>

since the first code snippet outputs the "img src" code to display the image I get an error with the link.
how do i output the url address of my field_image cck alone?
thanks

Comments

fluitfries’s picture

Don't have the means to give you exact code right now, but I swiped my lightbox code right out of the Meta theme. It works like a charm!

Check it out under the Themes section of drupal.org.

ezichko’s picture

i had a look but that seems to be for the gallery module.

I tried replacing VIEW for VALUE here:

 <?php foreach ((array)$field_image as $item) { ?>
      <?php print $item['view'] ?>
    <?php } ?>

but nothing gets displayed.

any ideas?

marcoBauli’s picture

try adapting this:

<?php foreach ((array)$field_main_image as $item) { ?>
      <div class="field-item"><?php print '<a href="http://yoursite.com/'.$item['filepath']. '" rel="lightbox"><img src="http://yoursite.com/files/imagecache/preview/'.$item['filepath']. '"></a>'; ?></div>
    <?php } ?>

works here (note i am using imagecache module also!)

cheers

ezichko’s picture

that works nicely, thanks!

marcoBauli’s picture

Status: Active » Fixed

setting as fixed to help clean-up the queue

Anonymous’s picture

Status: Fixed » Closed (fixed)