Currently, only the title field is displayed in the Lightbox. May I know how can I include the body field text in Lightbox?

Thanks in advance.

CommentFileSizeAuthor
#1 lightbox2_cck_141867.patch783 bytesstella
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

stella’s picture

Assigned: Unassigned » stella
Status: Active » Postponed
FileSize
783 bytes

For images that you add to a page yourself, you can just include it in the "title" attribute of the image link. For cck image data fields that appear in your custom views, you can use the attached patch. I'm not sure if it's possible to implement for the image galleries as the image nodes are modified in javascript and it can only use the html already produced by the image/image_gallery module.

It's not something I'm planning on implementing in the module unless more people want it and a way to implement it in the javascript can be found.

stella’s picture

Assigned: stella » Unassigned
huizache’s picture

This is a feature i am also intereseted in, because the body is where I have the description for the image. No other jscript gallery implementes this option, so if lightbox2 could have it, it could fill a nitche. If you can give me some details on where to start I can see to get help to code it.

stella’s picture

Version: 5.x-2.5 » 5.x-1.1

marked #178612, #254434 and #244857 as a duplicate of this issue.

stella’s picture

huizache: the main problem lies with the "image_nodes" js files in the lightbox2/js/ directory (ideally I'd like to replace those with just one file). The code in those files is loaded on each page (unless you've excluded certain paths). They parse the current page looking for image tags (img) which are surrounded by anchor tags (a). It then modifies the anchor tag to point at the larger version of the image rather than at whatever destination it was pointing to. It sets the title to the "alt" attribute of the image. The image node text isn't stored any where on the page, so it can not be easily displayed.

The only way I can think of right now is kinda messy. It involves first of all checking if the anchor destination is a node (node/xyz) which shouldn't be too hard. The tricky bit is once you have the node id (from the destination URL) how do you get the body text. It might be possible to get it from the database, but I'm not keen on javascript accessing the database directly. The only other idea I have is to try and load the destination url and parse out the body text.

The above is all rather messy. It probably deserves a bit more thought, maybe I'm missing an obvious solution. However, I won't be looking at this in any great detail until the jQuery version is finished - though you can speed that up by testing the DRUPAL-5--2.x branch! ;)

Cheers,
Stella

TwiiK’s picture

What's the latest update on this? Have you looked at it further? I'm currently setting up a gallery using lightbox, and this would be an awesome feature to have.

I was about to look at it myself, but my skills are way too limited. :)

stella’s picture

Version: 5.x-1.1 » 5.x-2.5

Well since my last comment, we now have a jquery version of lightbox2 and we have successfully removed all the "image_nodes" js files and combined them into one. However, we're still no closer to obtaining the body text to display in the lightbox. I'm unsure how to get the body text from within the javascript. To be honest, I haven't looked into this issue much recently. However, I will make some time for it after the next release which will hopefully be in the next couple of weeks.

Cheers,
Stella

jessejesse’s picture

I would love to have this as an option as well! Including body text just under the title would be amazing!

cheers,
jesse

Wolfflow’s picture

Version: 5.x-1.1 » 5.x-2.5

subscribe

stella’s picture

The latest dev version allows you to configure the lightbox so that the image node page is opened in the lightbox instead of the image itself.

See also #259323: Display image node body as image caption on how to modify your theme to add the image body text to the lightbox for CCK imagefields. (I won't be offering any support on this.)

stella’s picture

The ability to open the image node page in the lightbox, rather than the image, has been released in Lightbox2 5.x-2.7 and 6.x-1.7.

Cheers,
Stella

stella’s picture

Status: Postponed » Fixed

This has been fully implemented in the latest 5.x and 6.x dev versions (available later today).

Instructions:

  1. Download and install the latest dev release.
  2. Drupal 5.x users must copy the lightbox2/page-node-lightbox2.tpl.php file to their theme's own directory and ensure it is readable. This file can be modified to suit your theme.
  3. Select "HTML content" or "HTML content grouped" as the "automatic image handler" for image nodes on admin/settings/lightbox2/automatic.
  4. Enjoy!

Drupal 6 users do not need to do step 2 above. However, the default layout automatically provided by the module still shows the page header (logo + title, etc). If you don't want this to be visible, then do step 2 above.

Cheers,
Stella

Anonymous’s picture

Status: Fixed » Closed (fixed)

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

stella’s picture

Released in Lightbox2 5.x-2.8 and 6.x-1.8.

Cheers,
Stella

Damjan Dvorsek’s picture

As far as I understand this works for image nodes, what about some other node type where one (me :-) would want to have only body text in a Lightbox. I don't want images.

stella’s picture

Then just manually add the link like below. Syntax given is for the 5.x-2.8 version.

Simple link, will open up full node in lightbox, including sidebar blocks, etc:

<a href="/node/123" rel="lightframe">click here</a>

Open up the node content in a lightbox - without the sidebars, etc. You will need to copy the lightbox2/page-node-lightbox2.tpl.php file to your theme's directory and style as necessary.

<a href="/node/123/lightbox2" rel="lightframe">click here</a>

Complicated example, where you can group the lightbox with other links, set the lightbox size and provide a caption:

<a href="/node/123" rel="lightframe[mygrp|width: 400px; height: 500px][caption]">click here</a>

This is all described in the docs provided at http://drupal.org/node/252260

Cheers,
Stella

Damjan Dvorsek’s picture

thanks, I missed that, I was looking under inline content.

Jean-Philippe Fleury’s picture

subscribing

farald’s picture

Subscribing

Junro’s picture

Status: Closed (fixed) » Active

Hello, I can't make only Body field appears in my Lightbox.

<a href="/node/123/lightbox2" rel="lightframe">click here</a> works fine but I want only to display the node body.

I copied the page-node-lightbox2.tpl.php file in my theme's directory but the file has no effect on the lightbox.

Any idea?

Thanks :)

gauravkhambhala’s picture

Same here as #20 comment.

Junro’s picture

Status: Active » Fixed

Ok, Copy the page.tpl of your own theme and rename it to page-node-lightbox2.tpl.php.

And customize it as you want.

It works :)

Status: Fixed » Closed (fixed)

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

nags338228’s picture

in my body field im having .swf(shock wave flash).then how would i make if any of the user clicks on the link it should display that .swf file

nags338228’s picture

im having a page with body containing an embed tag with .swf file.so when i click on specific link,it should display that node swf content in light box.please give me suggestions

Aamuktha’s picture

Title: Body field in Lightbox » One of the node field in Lightbox
Version: 5.x-2.5 » 6.x-1.11
Status: Closed (fixed) » Active

Hi buddies.

I'm using Drupal6.I wanna to print the data in one of the field in the node in lightbox2.
I'm having the field "description" and "alternate text" for the image field.
The images will be showing up in lightbox ,in that lightbox i have to print the
description and alternate text field .

Wat i have to do for that?

Can anyone help me in this?

Thanks for your help in advance.

  • stella committed ca79f67 on 8.x-1.x
    #141867 - added ability to open node page without sidebars in an iframe...

  • stella committed ca79f67 on 7.x-2.x
    #141867 - added ability to open node page without sidebars in an iframe...
joseph.olstad’s picture

Version: 6.x-1.11 » 7.x-2.0
Issue summary: View changes
Status: Active » Fixed

fixed in 7.x-2.0
if you want this fix then please upgrade to 7.x-2.0

Status: Fixed » Closed (fixed)

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