I am using lightframe for users to edit a node and I wanted to use Rules to close the lightbox window when the node is updated.

How do I call the "close lightbox" function from PHP / javascript ?

I can't use lightmodal because the form will include <html><body> tags.

Comments

Anonymous’s picture

Any progress here? I need the same thing.

astanley86’s picture

Yes! My friend gave me the solution here's what you do:

create an confirmation.html page with the following code:

<html>
<head>
<script>
              if (top === self) //returns true if the page is not inside a frame/pop-up
              {
                      //do nothing because we're not in a frame/pop-up
              }
              else
              {
                      //yes we're in a frame, so reload the entire window
                      top.location.reload();
                      window.stop();
                      document.execCommand('Stop');

              }
</script>
</head>
</html>

Then you just set up rules to have the page be redirected to "confirmation.html" when content is updated. I only wanted a certain content type to open in lightbox so you would want to add that parameter to the rule.