Using image gallery - can the body text be displayed?

staino83 - July 8, 2008 - 04:47
Project:Lightbox2
Version:6.x-1.8
Component:User interface
Category:support request
Priority:normal
Assigned:Unassigned
Status:closed
Description

Im using image gallery with lightbox 6.x-1.8. I wanted to know if its possible to display the body text in the lightbox image? Currently i can only display the title text.

Regards
Sam

#1

stella - July 8, 2008 - 09:00
Status:active» fixed

Assuming you're referring to image nodes, you can display the node content in a lightbox using the "HTML content" option under the "automatic image handler for image nodes" drop down list on admin/settings/lightbox2/automatic.

Cheers,
Stella

#2

staino83 - July 9, 2008 - 09:06

Thanks for the tip. Im not sure if i am meant to be asking this question here - should it be moved to the forums?

I have switched to HTML content - but it seems as though the whole page displays. Is this how it functions or is this a problem with the template?

You can view on the demo site here:
http://fresh.debosoft.com.au/image/tid/1

Regards
Sam

#3

stella - July 9, 2008 - 09:16

See http://drupal.org/node/252260 - you can copy a tpl.php file to your theme's directory and override the layout there.

Cheers,
Stella

#4

promes - July 19, 2008 - 18:48

I have the same question but in another setting. I like to display a text related to the image node-title not not identical to the title.

I am now using version 5.x-2.8 and the image module. I installed the image gallery and changed the module to output the rel= and title= fields.
The body text is very small: it contains only the dimensions of the painting on the image.
I tried the following alternatives:
1. rel="lightshow[hk]" title="node title + bodytext". Result in 5.x-2.7: no description in the lightbox. In 5.x-2.8: only the node-title.
2. rel="lightshow[hk][node title + bodytext]". Result only the node-title in the lightbox.
3. no rel= nor title= info. Result the node-title in the lightbox (being some default).

Is it possible to use format 2: rel="lightshow[hk][sometext]" to display my own text, not identical to the node title? Maybe its only a matter of a setting somewhere.

Thanks for a great module. The result is fantastic.

#5

stella - July 19, 2008 - 19:05

If it's not an automatically created lightbox link, then the 2nd option should work. However, if the lightbox rel attribute is normally added automatically then anything you set on the link will probably be overwritten by the javascript.

If it's not an automatically handled image, and it's still not working, then please open a separate issue with more details, including details of your site.

Cheers,
Stella

#6

promes - July 21, 2008 - 07:18

Thanks for your quick reply Stella.
I have been tinkering today and found out I have to disable the automatic Image node handler.
There was some difficulty by restructuring the body text: newline codes (< p and /p >) and newline characters are not accepted: the result is no title info at all. With some added code I changed those codes into < br /> and no-characters.
After that it is working the way I like it.

You can see the result at: www.hettykruk.nl/schilderijen

Thanks,
Joep

#7

ryooki - July 22, 2008 - 15:32

I am looking for a similar solution. I like the functionality of the html content, which I'm using for image nodes. It solves a lot of prior requests that were made of the lightbox module. :) I'm using the automatic image handler for everything, and currently I'm trying to use html content grouped for images inside image galleries.

I want to tweak how my html content looks. From http://drupal.org/node/252260, it appears I need to edit page-node-lightbox2.tpl that is in the sites/all/modules/lightbox2 folder? Please correct me if I'm wrong. I've tried deleting a lot of the code listed, and currently it looks like:

<?php
// $Id: page-node-lightbox2.tpl.php,v 1.1.2.2 2008/06/11 22:16:38 snpower Exp $

/**
* @file
* Template file for displaying the node content, associated with an image, in
* the lightbox.  It displays it without any sidebars, etc.
*/
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php print $language->language ?>" lang="<?php print $language->language ?>" dir="<?php print $language->dir ?>">
  <head>
    <title><?php print $head_title ?></title>
    <?php print $head ?>
    <?php print $styles ?>
    <?php print $scripts ?>
    <!--[if lt IE 7]>
      <?php print phptemplate_get_ie_styles(); ?>
    <![endif]-->
  </head>
  <body>

<!-- Layout -->

    <div id="wrapper">
    <div id="container" class="clear-block">


      <div id="center"><div id="squeeze"><div class="right-corner"><div class="left-corner">
<?php phptemplate_comment_wrapper(NULL, $node->type); ?>

    <?php print $content ?>

</div>
</div>
</div>
</div>
</div> <!-- close container -->
</div> <!-- close wrapper -->
</body>
</html>

It hasn't made a dent in looking more barebones, however. I'd like it to just show the image title, image, and a comment box inside the iframe. Any advice how I can accomplish that?

#8

stella - July 22, 2008 - 15:55

ryooki: yes, you need to modify the page-node-lightbox2.tpl.php file. An example file is included in the lightbox2 module directory. You need to copy this to your theme's directory and modify it there. I'm not an expert in themeing so you might be better off asking your question in the themes forum or the #drupal-themes irc channel.

Cheers,
Stella

#9

ryooki - July 22, 2008 - 16:15

Thanks for the lightning fast response. Just to double check, do I still need to copy the page-node-lightbox2.tpl.php file over if I'm using Drupal 6.x?

#10

ryooki - July 22, 2008 - 16:55

I figured it out. I did need to copy the page-node-lightbox2.tpl.php file over. I got it working now. Thanks a bunch!

#11

Anonymous (not verified) - August 5, 2008 - 17:28
Status:fixed» closed

Automatically closed -- issue fixed for two weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.