We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 39124
    • 1 Posts
    For about two years, I've been using WebLogin to protect a Tee Time Reservation system for my non-profit group's golf course. On the web site, the links to "Book a Tee Time" all point to a page with the WebLogin snippet call, using a Chunk named "userLogin": [!WebLogin? &loginhomeid=`8` &logouthomeid=`7` &tpl=`webloginTPL`!] . Obviously, 7 is the page containing the login, and 8 is the page containing the reservation script (which is access protected.)

    The website template is not very "phone-friendly," so I'm using jQuery Mobile to build a simplified site at www.hastingselksgolf.com/mobile that uses jQuery Mobile code in a template named "Mobile." displays well on the phone. My initial thought was simply to create a new Chunk named "mobileLogin," and change the targets: [!WebLogin? &loginhomeid=`103` &logouthomeid=`102` &tpl=`webloginTPL`!] -- with 102 containing the WebLogin snippet call in the Mobile template, and 103 being the reservation script in the Mobile template.

    However, my login redirects are all screwed up. It doesn't go to 103 when I login, but instead reloads 102. Is this a problem with using two different snippet calls with different parameters for the same snippet? Any idea what I'm doing wrong?

    Thanks!

    Duane
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      I would use a couple of TVs with @EVAL to return the appropriate resource IDs. I would use the TV to avoid nested snippets. You can use the ManagerManager to hide the TVs since you won't want to edit them.

      I'm not familiar with what would need to be done to determine the client type, but I would presume a reasonably simple ternary conditional something like this for the loginhomeid
      @EVAL return (is-mobile) ? 103 : 8;


      Then the snippet call would look like this
      [!WebLogin? &loginhomeid=`[*homeid*]` ... !]


        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