5

I have a content type 'students' with fields name, description and a photo. I have created a view(Block) to display only the images of the students. When the teacher/user clicks the photo of the student, It must show up the name, description and the photo of the student in a overlay/lightbox effect.

I have tried using Lightbox2 and colorbox node module to achieve as per my needs, But needed up in failure. Any help is widely appreciated.

Thanks.

  • what is the error or problem you are getting while doing it with lightbox2 ? – j2r Oct 8 '12 at 4:56
  • I could just display the image in the lightbox, It does not shows the full node. I tried both Lightframe and lightshow rel. – Gladiator Oct 8 '12 at 5:05
  • 1
    You could display any link in popup using lighnbox. Just add rel="lightbox" in your anchor type where you are giving the link of the node and the node will pop-up. :-) – j2r Oct 8 '12 at 5:08
  • I added lightbox to the rel (Just made it with the firebug) and the page is redirected to the full node page:( – Gladiator Oct 8 '12 at 5:27
  • 1
    NO, Do not do it with firebug. As lightbox2 js is used to check all the link which has rel='lightbox' on the page ready state. so your firebug edit will never work. Do it in static block in drupal and then test. I am sure it will work. – j2r Oct 8 '12 at 6:56
7

Let me answer my own question. Based on j2r's comments and http://drupal.org/node/1378438 question from this node I was able to solve my issue.

Create href as node/nid/lightbox and rel as lightframe. This will result in displaying the whole page in the lightbox. To avoid this U need to create a page--contenttype.tpl.php (In my case) http://www.digett.com/blog/01/11/2012/overriding-page-templates-content-type-drupal-7 and then remove the header, footer and other unwanted regions in the page.

Once this is done I am sure u will get as what I got.

  • I am unable to do that now, I need to wait for another 2 days to accept:) – Gladiator Oct 8 '12 at 7:32
0

You can do it using Ctools module. You need module development skills to achieve above functionality. You need to create a new ctools menu path, and pass the nid to that menu callback to display related details.

Check it out the ctools_ajax_sample module inside ctools module for implementation of overlay popup.

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.