I should be able to nest a custom form in a standard page via a nest content div… yes?
I was sure it was possible but when I click to submit the form it just reloads the whole page (which is expected) but there is no submission added to the submission log. After the reload it shows the form uncompleted. There are no errors in the system log or error log.
I can try adding the content of the nesting page to the form bodycopy I know but it seems like the above should work…
Form works fine when not nested.
(3.24.2)
Nesting custom forms
Nesting forms into standard pages is generally not a good idea because of caching. When the standard page you are nesting into caches the content, it caches the first page of the form as well. So when you submit that form, the standard page just shows the first bit of content again.
The only way around this is the turn off caching, but that is not a good idea.
A better idea is to put the standard page content into the form itself. The form does not do any caching, but when it nests in standard page content, that content will be cached. So if you can redesign the page to be a custom form, you'll be ok.
The other thing you could do is use a different design for this page and put the form into a design area that is not cached. You can pick which design areas are cached, so you get a bit more flexibility there.
I saw Greg's reply for nested form here before. Rachel if you use FF web developer add-on to compare the response header of the standard page and the form you'll see the difference.
Oh man, I can't tell you how many problems this has caused us before…
If you absolutely have to nest a form, I've got some jquery which might help you. It's certainly not semantic or clean in anyway…
Okay, seems like it's not worth the headache. I'll nest the page into the form rather than the other way around. Thanks!
[quote]
I should be able to nest a custom form in a standard page via a nest content div… yes?
I was sure it was possible but when I click to submit the form it just reloads the whole page (which is expected) but there is no submission added to the submission log. After the reload it shows the form uncompleted. There are no errors in the system log or error log.
I can try adding the content of the nesting page to the form bodycopy I know but it seems like the above should work…
Form works fine when not nested.
(3.24.2)
[/quote]
So what happens when I open up the form on it's own (not nested) and it does the same thing? Is this the same reason why my confirmation page always shows up when I reload the page instead of the form itself?
[quote]
So what happens when I open up the form on it's own (not nested) and it does the same thing? Is this the same reason why my confirmation page always shows up when I reload the page instead of the form itself?
[/quote]
You might have something else caching, like the BODY design area (which should not be enabled for non-static sites) or you might have a proxy caching the content like Squid. Or maybe you have asked Matrix to send cacheable headers for proxies and the browser is actually caching the page and requires you to force refresh the page.
We can't tell without taking a look at your system, but those are a few things to check.
Hi Greg,
can I just confirm that when you say "A better idea is to put the standard page content into the form itself" that you're recommending putting the content that was in the Standard page into the Bodycopy of the Custom form?
[quote]
Nesting forms into standard pages is generally not a good idea because of caching. When the standard page you are nesting into caches the content, it caches the first page of the form as well. So when you submit that form, the standard page just shows the first bit of content again.
The only way around this is the turn off caching, but that is not a good idea.
A better idea is to put the standard page content into the form itself. The form does not do any caching, but when it nests in standard page content, that content will be cached. So if you can redesign the page to be a custom form, you'll be ok.
The other thing you could do is use a different design for this page and put the form into a design area that is not cached. You can pick which design areas are cached, so you get a bit more flexibility there.
[/quote]
[quote]
can I just confirm that when you say "A better idea is to put the standard page content into the form itself" that you're recommending putting the content that was in the Standard page into the Bodycopy of the Custom form?
[/quote]
That's correct. Or nesting the standard page into the bodycopy of the form using a Nest Content DIV.
The standard page will still cache itself. The Custom Form will do no caching, but it will be loading in a cached page anyway.
Because of our site implementation, we did not have the choice of not nesting a form into our standard pages, But luckily we use a reverse proxy in front of our Matrix server so we are able to just do some url rewriting in the Apache reverse proxy:
eg.
RewriteRule (.*our-enquiry-form$) $1/ [R] RewriteRule (.*our-enquiry-form/$) $1_nocache [R,L]
For those who have a reverse proxy or are able to modify their Matrix Apache config, this provides another work around the nasty Form caching issue.
Maks.
Oh man, I can't tell you how many problems this has caused us before...
If you absolutely have to nest a form, I've got some jquery which might help you. It's certainly not semantic or clean in anyway...
Do you still have the "dirty" JS in question...?