We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 3559
    • 57 Posts
    I have two campuses for our church. I want to create a Lightbox window to open when they visit FBCJax.com - with two buttons - Downtown and South. South would take them to fbcjax.com/south and the Downtown just closes the lightbox. I want a cookie set to remember the settings, so that a visitor will then type fbcjax.com, and if South had been set, it would redirect properly. Any ideas how to do this?
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      1. The snippet that processes the initial selection sets a cookie if it’s redirecting. Or set the cookie with a snippet or plugin on accessing the redirect page. If the selection is all done in javascript, set the cookie with javascript. In other words, at some point set a cookie to indicate the selection has been made.

      http://www.quirksmode.org/js/cookies.html

      2. Another snippet, probably in the head of your templates, or a plugin looks for the cookie and redirects if it’s set.

      That leads to a question; what happens if the person for some reason wants to view the other part? Once the cookie is set, he keeps getting redirected back to South.
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 3559
        • 57 Posts
        ahhh, good question. They can still click Downtown or South to check out the other sites, but I would need a way to allow them to "change default campus". Hadn’t thought of that. (Dang - another wrench)
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          Have an option button for "Downtown" that destroys the cookie and redirects to the main site?
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org