We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22424
    • 6 Posts
    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!
      • 33372
      • 1,611 Posts
      Is the snippet being called uncached?
        "Things are not what they appear to be; nor are they otherwise." - Buddha

        "Well, gee, Buddha - that wasn't very helpful..." - ZAP

        Useful MODx links: documentation | wiki | forum guidelines | bugs & requests | info you should include with your post | commercial support options
        • 22424
        • 6 Posts
        How do I tell? And does it make a difference?
          • 33372
          • 1,611 Posts
          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).
            "Things are not what they appear to be; nor are they otherwise." - Buddha

            "Well, gee, Buddha - that wasn't very helpful..." - ZAP

            Useful MODx links: documentation | wiki | forum guidelines | bugs & requests | info you should include with your post | commercial support options
            • 22424
            • 6 Posts
            That’s the problem! Thanks so much!