Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#1 | lightbox2_cck_141867.patch | 783 bytes | stella |
Comments
Comment #1
stella CreditAttribution: stella commentedFor 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.
Comment #2
stella CreditAttribution: stella commentedComment #3
huizache CreditAttribution: huizache commentedThis 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.
Comment #4
stella CreditAttribution: stella commentedmarked #178612, #254434 and #244857 as a duplicate of this issue.
Comment #5
stella CreditAttribution: stella commentedhuizache: 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
Comment #6
TwiiK CreditAttribution: TwiiK commentedWhat'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. :)
Comment #7
stella CreditAttribution: stella commentedWell 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
Comment #8
jessejesse CreditAttribution: jessejesse commentedI would love to have this as an option as well! Including body text just under the title would be amazing!
cheers,
jesse
Comment #9
Wolfflow CreditAttribution: Wolfflow commentedsubscribe
Comment #10
stella CreditAttribution: stella commentedThe 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.)
Comment #11
stella CreditAttribution: stella commentedThe 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
Comment #12
stella CreditAttribution: stella commentedThis has been fully implemented in the latest 5.x and 6.x dev versions (available later today).
Instructions:
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.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
Comment #13
Anonymous (not verified) CreditAttribution: Anonymous commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #14
stella CreditAttribution: stella commentedReleased in Lightbox2 5.x-2.8 and 6.x-1.8.
Cheers,
Stella
Comment #15
Damjan Dvorsek CreditAttribution: Damjan Dvorsek commentedAs 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.
Comment #16
stella CreditAttribution: stella commentedThen 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:
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.Complicated example, where you can group the lightbox with other links, set the lightbox size and provide a caption:
This is all described in the docs provided at http://drupal.org/node/252260
Cheers,
Stella
Comment #17
Damjan Dvorsek CreditAttribution: Damjan Dvorsek commentedthanks, I missed that, I was looking under inline content.
Comment #18
Jean-Philippe Fleury CreditAttribution: Jean-Philippe Fleury commentedsubscribing
Comment #19
farald CreditAttribution: farald commentedSubscribing
Comment #20
Junro CreditAttribution: Junro commentedHello, 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 :)
Comment #21
gauravkhambhala CreditAttribution: gauravkhambhala commentedSame here as #20 comment.
Comment #22
Junro CreditAttribution: Junro commentedOk, 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 :)
Comment #24
nags338228 CreditAttribution: nags338228 commentedin 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
Comment #25
nags338228 CreditAttribution: nags338228 commentedim 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
Comment #26
Aamuktha CreditAttribution: Aamuktha commentedHi 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.
Comment #29
joseph.olstadfixed in 7.x-2.0
if you want this fix then please upgrade to 7.x-2.0