Active
Project:
Lightbox2
Version:
7.x-1.0-beta1
Component:
User interface
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
30 Dec 2012 at 22:19 UTC
Updated:
12 Apr 2013 at 06:04 UTC
I have the Text for Image Page link field set to use the "View Image Details" text. However this text does not show up in the modal Lightbox window for my images. This is a Drupal 7 site.
Suggestions?
-Trevor
Comments
Comment #1
MystLynx commentedHowdy! I guess, my answer a bit late for you, but maybe it will help others. For some reason, "View Image Details" from Text for image page link field do not pass into Lightbox rel attribute in D7, while in D6 it works ok. I'm not good coder, so I won't hack the module. Instead, I found a solution by using Views module.
All we have to do is just build a correct link. In Views create a view and add next fields:
Content: Nid, Content: Title, Content: Path, Content: Image, Content: Image (yes, 2 same image fields). Exclude them all from display except last Content: Image. And then:
1) Content: Path - you need to go to field settings, Rewrite Results and check "Rewrite the output of this field" and place a link inside:
<br /><br /><a href='[path]' id='lightbox2-node-link-text'>View Image Details</a>2) First Content: Image should has Formatter as "Image URL" (you need to install Image url Formatter module).
3) Second Content: Image should has Formatter as "Image", Link image to "Nothing" and you need to go to Rewrite Results and check "Rewrite the output of this field". Put this link there:
<a class="lbx" rel="lightbox[[nid]][[title][path]]" href="[field_image]">[field_image_1]</a>That's it. Now just embed view into node or whatever you want:
<?php echo views_embed_view('my_view', 'block', $node->nid); ?>Also, you can build the same link by php snippet in node.tpl.php:
<a class="lbx" href="<?php print render(file_create_url($node->field_image['und'][0]['uri'])); ?>" rel="lightbox[<?php print $node->nid; ?>][<?php print $node->title; ?><br /><br /><a href='<?php print $node_url; ?>' id='lightbox2-node-link-text'>View Image Details</a>]">View Image Details</a>Comment #2
MystLynx commented{Sorry for triple post. Drupal.org crashed several times yesterday and doesn't allow me post the answer.}
Comment #3
MystLynx commented{Sorry for triple post. Drupal.org crashed several times yesterday and doesn't allow me post the answer.}