I’m creating a small signup field that will appear on multiple pages, using a snippet. However, when a user puts their email in the form and hits submit nothing happens, unless afterwords you hit refresh. It’s almost as if the $_REQUEST or $_GET is not getting pulled in unless it is refreshed. I think it has to do with the mod_rewrite not properly passing on the request information, however, I’m not 100% sure how to overcome that. Any ideas out there?
Thanks!
Is the snippet being called uncached?
How do I tell? And does it make a difference?
It definitely makes a difference. If your page is cached and the snippet is as well, then the output on the snippet will not change unless the cache is refreshed (which you do within the manager, manually or if you edit a page and that option is checked). Some snippets should be cached because they don’t need to be run on every page load (e.g., generating a menu in WayFinder), but others must be uncached because they need to provide dynamic output (e.g., a signup form).
[[mysnippet]] is a cached snippet call, and [!mysnippet!] is an uncached one.
If your snippet is cached then the problem is not that it’s not receiving the $_GET var but rather that it doesn’t run at all except for the first time the page is loaded (after that its output is saved into the cache).
That’s the problem! Thanks so much!