I have created a view. The view contains a title. The title currently links to the node.

I have Lightbox 2 installed.

To get the node to load in the lightbox I have to add more information to the link see below:

<a href="/path?format=simple" rel="lightframe[|width:800px; height:600px; scrolling: auto;]">click here to see node content</a>

URL paramenters Format = simple makes only the content of the node load in the lightbox window.

My question is how do I add the additional information (?format=simple & rel="lightframe[|width:800px; height:600px; scrolling: auto;]") to the view title link

I am using Drupal 7

  1. In your title field deselect "Link this field to the original piece of content"
  2. select "Rewrite the output of this field"
  3. add two fields "Content:path" *"Global:Custom text"* and hide them from display by selecting "Exclude from display "
  4. In the Global:Custom text field select Rewrite the output of this field and enter lightframe[|width:800px; height:600px; scrolling: auto;]
  5. Go inside your title field again. Look under "Replacement patterns" for [view_node] and build up your link. Make sure the two fields Content:path and Global:Custom text are arranged before your title field or else you wont be able to use them.

Your link should look something like:

<a href=[path]?format=simple rel=[nothing]>[title]</a>
  • Struggling to get the rel bit to display though. I figured <a href="[path]?format=simple" rel="lightframe%5B|width:800px; height:600px; scrolling: auto;%5D">[title]</a> should work but it displays <a rel=" auto;%5D" href="/about/news/7clearn-goes-live?format=simple" class="views-ajax-processed-processed">7clearn goes live</a> – Mark Christopherson Sep 27 '12 at 12:56
  • Ah it strips out certain characters. Well then you can add another field "Global: Custom text". Put this piece of code in lightframe[|width:800px; height:600px; scrolling: auto;] exclude it from display and then in your title field <a href=[path] rel=[nothing]>[title]</a> – undersound Sep 27 '12 at 14:07

I used your method above after many hours of searching and it worked perfect.. but instead of using a 'title' field, i'm using an image thumbnail that i want to open in a lightbox with a larger image and the rest of the fields[node].. works great. only issue is.. when i logged out as administrator.. and you click on the thumbnail, lightbox opens, but it's blank white.. can't figure out for the life of me why. permissions are set as should be..nothing weird.. any idea?

my rewrite looks like this for the one photo field: [field_your_photo_1] everything works great when logged in as admin, it's just empty white box when logged out..

ALTHOUGH... i must state, that when i don't use the rewrite text above....and i'm logged out, the image opens fine in lightbox (just missing node content) so it makes be wonder if some strange permission that annon users can't see the rewrite text. what do you think?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.