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.
How do i jump to another node, via a link, in an open lightmodal window? When the user clicks the link, I want the window's contents to be replaced with the linked node's contents.
Sorry if this has been covered before - i was unable to find a reference to it.
Comments
Comment #1
ah0 CreditAttribution: ah0 commentedlooking to do the same,
found any solutions to this?
cheers,
Comment #2
Hunabku CreditAttribution: Hunabku commentedWell someone else claims to have solved this back in 2009 by following the suggestion given here.
However i tried following it to the T and i was unable to replace the content in a currently open modal with content from a linked url. Perhaps we have something in our configuration(other modules, etc) that is causing the parent page to go to the linked content instead of it showing up in the modal iframe.
Anyway i solved my issue with some page embedded jQuery. I designed my simple.tpl.php file with the following basic structure:
One of the keys here is the id = "jquery-content-container" that must be assigned to the container div that encompasses all of the content in your simple.tpl.php. Another key is for all links that you want to open in the same modal to have a class = "replace-content".
Hope this helps - sure did take me awhile to figure it out.
Comment #3
ah0 CreditAttribution: ah0 commentedThe solution looks great, I'm going to give it a try...
Thanks aagain,
cheers,
amir