Thought i would make a feature request for this one, sice i desperatly need it too. Many seemed to be interested in this feature...it just makes sense for galleries.
I use the image module to create image nodes and image_gallery to sort the images of artwork and display in galleries. I used CCK to create a field of 'dimensions' in the default 'Image' content type, so that I can upload a photo of artwork and list the title, description, and dimensions on the node. However I use Lightbox to display the images from the gallery, which works great except that lightbox only displays the image and the image title. I want Lightbox to display the title and dimensions, one above the other, below the image. I know of the option to display the whole node, but this is not a good option as I want the site to be simple and clean. I just want to display images with their respective title and dimensions from image galleries, with Lightbox. Thanks!
Comments
Comment #1
stella commentedI don't really plan on implementing this. However you can achieve the same effect by loading image nodes in a lightbox as you say. You can customize the image node page using a page-node-lightbox2.tpl.php template file in your theme's directory, as documented at http://drupal.org/node/252260 However, you could also create a node-lightbox2.tpl.php and use that to configure which node fields should appear and where they appear. So you could display just the image and the dimensions, but not the body if you so wished. Check out the contemplate module, which is very useful for creating the necessary customized template files.
Cheers,
Stella
Comment #2
glassman3000 commentedThanks for the reply. I used the lightbox2 supplied page-node-lightbox2.tpl.php file by inserting it into my theme's directory. I now get an error and nothing in the display but an error messege:
Fatal error: Call to undefined function phptemplate_get_ie_styles() in /homepages/6/d147115223/htdocs/sites/all/themes/psd2css/page-node-lightbox2.tpl.php on line 18.
Are you saying that I can use JUST the node-lightbox2.tpl.php instead of using page-node-lightbox2.tpl.php? to get the results Im looking for? If so, could you eloaborate a little more about how the node-lightbox2.tpl.php should look. I imagine I would maybe just use the default node.tpl.php from the node module to start, correct?
Thanks Again!
Comment #3
stella commentedYou get that error because the sample template file is for the default garland theme. You'll need to customise it to suit your own. Try modifying it and remove the call to phptemplate_get_ie_styles().
You need a page-node-lightbox2.tpl.php to prevent the sidebars and header from appearing.
You need the node-lightbox2.tpl.php file to customise where and which fields should be displayed. Using your own node.tpl.php file is a good start. Likewise you could use your page.tpl.php file as the starting point for your own page-node-lightbox2.tpl.php and remove the sidebars and header from that.
Comment #4
glassman3000 commentedYeah I ended up figuring that one out. I modified the page-node template with success. However, the node-lightbox2.tpl.php is another story. Since I have started using Drupal I have learned a ton about web developemnt, a huge reason being that there is a ton of community support for the CMS, so thanks Stella and all the others who take the time to help and maintain. That being said I have a lot to learn about coding. Learning drupal has not been easy but Ive been able to figure out every single problem I have run into. I do feel kind of beat on this one. All I want to do is display a couple of extra fields in lightbox so I can have a clean, simple way of displaying gallery images with dimensions and a title. At this point I am faced with having to code php blindly to get this, as I have left the comfort zone that is Drupal. I realize that how the iframe is integrated may present problems when trying to implement what would normaly be solved with a little CSS. Which leaves me wondering, can I use CSS to style the contents of the iframe, or rather the node displayed in the iframe? Having the ability to display additional fields in the lightbox would be awsome, and would be a much better idea than separating text in the title field with dashes to get some extra ones in there. I can imagine what it takes to develop and maintain one of these modules, and I know you said that you dont plan on adding this feature, but what if I said PLEASE??? lol
Seriously, it would be a great feature, and I would implore you to reconsider your stance.
Regards,
Marc
Comment #5
dbeall commented@glassman3000 , I feel your pain. Trying to add a few fields to lightbox2 seems to be major surgery.
Comment #6
stella commentedYou should also check out #474454: Views lightbox2 custom field handler (update)
Comment #7
dbeall commented@stella, Thank you very much, I am investigating getting captions and (maybe) other possible items to display in lightbox2 with node_gallery. The requests have driven me to looking for an option that everyone can enjoy with some level of ease.
BTW, I just love the lightbox2 mod, The advanced options are really neat. I see many of them just set to black.. I have it set to red with 05 overlay(a neat look) for my test site.
I looked at the items on your site, you are a very talented artist. I always liked one of a kind pieces.
Thanks again for the tip, I'm gone reading and learning more!
Comment #8
Evariste-1 commentedI'd love this capability! It's exactly what I need: To be able to display the body, say, in the bottom area of the lightbox pop-up. Is there any headway on this? I looked at the work-arounds mentioned and they look quite time-consuming (curve-wise) for a noob like me.
Great module!
Comment #9
Evariste-1 commentedOK, I figured out another work-around on how to put the body of the image node into the lightbox display.
All you have to do is to create a custom module, implement a theme hook_image_display to put the body as the title attribute of the image thumbnail, make a very minor modification to auto_image_handling.js and voila! Problem solved. It has the additional benefit of displaying the body information when the mouse hovers over the image. If there are images that you still want the title to display there (i.e. non-gallery images), you could simply put body=title.
Here's the code for the custom module:
The only change to auto_image_handling.js is on line 164 (added breaks and img_title to the rel)
rel = rel + "[" + alt + title_link + "<br /><br />" + img_title + "]";Comment #10
wyocrook commentedYou know this is a difficult challenge. I wanted multiple lines of text. What I ended up doing was adding
<br />tags to my title. I'm close to understanding... line 204 on my lightbox2.formatter.inc:$caption = $image_title;
I know to do this:
$caption = $image_title . '
<br />' . $image_subtitle;But I do not know how to define $image_subtitle, at least dynamically so that it changes based on the node. I tried inserting php code in the body section, but that did not work.
Cheers