I would like to insert PloneFormGen form into an iframe on different third party sites, just as a common share widget. The use case is a petition using collective.megaphone. The form should be displayed, validated and thank you page displayed in embedded mode in the iframe.
It basically, works, I can use http://my.site/my-form/@@embedded as iframe source and the form is displayed and validated inside iframe, but as soon as the form is submitted, Thank you page is displayed inside iframe in full Plone layout including header, portlets etc. This is not what I really want. I'm looking for embedded version of thank you page.
I have created embed.js for IMegaphone which returns a snippet inserting an iframe into target page DOM. The iframe src points to custom template which returns just embedded version of the form
That works well but I don't know how to handle the thank you page. I want the form work properly on master website so I can't use any thank you page override.
Hi Guido,
that does not solve my problem or I didn't get it. Even if I create embedded version on own site, the thank you page is still displayed in full Plone layout. So, I can create a stripped-down template with <div tal:content="structure form/@@embedded" /> inside but as soon as the form is validated and submitted, the thank you page is displayed in full.
Honestly, I would like to use different version of thank-you page for the embedded version but in that case I would have to temporarily change 'thanksPageOverride" settings.
you've to change the post action to a template that does not load the
full Plone layout. Use the override tab on PloneFormGen object to put
the name/address of the template.
I want to display thanks page in full layout if the form is processed on the "master" site so I can't change thanksPageOvereride
What I would expect from PFG is to use embedded version of thanks page in case of embedded form, so instead of traversing to thank-you page it should traverse to thank-you/@@embedded
I want to display thanks page in full layout if the form is processed on
the "master" site so I can't change thanksPageOvereride
The point is that you can override the thank-you page with a stripped
down version. But you need to embed the original form in your own side
as well, so that both the form and the thank-you load in an iframe
within a page that provides your chrome.
:*CU#
Guido Stevens | +31.43.3618933 | http://cosent.nl
s o c i a l k n o w l e d g e t e c h n o l o g y