Search code examples
htmldjangoiframedjango-templateshref

Is it possible to configure a link to open a page that contains an iframe, and have that iframe query an URL?


I am setting up a registration confirmation email system.

The sign-up process usually takes place on my platform, and upon receiving the confirmation email, the link redirects to the same website the new user has signed-up on.

But the sign-up page I'm having trouble with is contained in an iframe on a website that I have no control over. I can only change what's inside of the iframe.

I would need the link sent through email to redirect to the page that contains the aforementionned iframe, while still activating the user in the iframe.

I work with django templates. I can change the body of the email, the registration page and the confirmation page, that's about it.


Solution

  • Not possible.

    However, in your HTML you can detect that you are in an iframe using javascript and use that to add a parameter to the form (e.g. a hidden input field) so that in Django you will know this comes from the iframe and you also know via the Referer header the address of the parent website.

    Once you know that, you could make the email confirmation page tailored for the parent website, e.g. add a link back to it or make it look different than your normal confirmation page.