We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 5393
    • 63 Posts
    Hi,

    I am looking for your guys help to set up login page. after I click the submit button in my login page, the page doesn't go to the page inside.

    the Snippet call I use is:
    [[!Login? &loginTpl=`lgnLoginTpl` &logoutTpl=`lgnLogoutTpl` &errTpl=`lgnErrTpl` &loginResourceId=`76` &logoutResourceId=`71`]]

    76 is the page I want members to access to. I put this snippet inside document page.

    thanks for your help.

    ernest
      • 3749
      • 24,544 Posts
      You need to wrap the code in code tags so we can see it.
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 5393
        • 63 Posts
        [[!Login? &loginTpl=`lgnLoginTpl` &logoutTpl=`lgnLogoutTpl` &errTpl=`lgnErrTpl` &loginResourceId=`76` &logoutResourceId=`79`]]


        I name this snippet as login
        I put this snippet in document and call it
        [[!login]]
        in login page.

        thx
        ernest [ed. note: cktai last edited this post 14 years, 10 months ago.]
          • 3749
          • 24,544 Posts
          You need to use the full tag where ever you put it.
            Did I help you? Buy me a beer
            Get my Book: MODX:The Official Guide
            MODX info for everyone: http://bobsguides.com/modx.html
            My MODX Extras
            Bob's Guides is now hosted at A2 MODX Hosting
            • 5393
            • 63 Posts
            what do you mean by full tag?

            thx
              • 3749
              • 24,544 Posts
              I meant that you should always use this in the resource content field:

              [[!Login? &loginTpl=`lgnLoginTpl` &logoutTpl=`lgnLogoutTpl` &errTpl=`lgnErrTpl` &loginResourceId=`76` &logoutResourceId=`79`]]



              Not this:

              [[!login]]



                Did I help you? Buy me a beer
                Get my Book: MODX:The Official Guide
                MODX info for everyone: http://bobsguides.com/modx.html
                My MODX Extras
                Bob's Guides is now hosted at A2 MODX Hosting
                • 5393
                • 63 Posts
                Hi BobRay,

                I try to put this code into my login page. however it still couldn't jump to "index.php?id=76" as I want. The login page is index.php?id=74 and it just stay in the same login page after clicking the submit button. what is the reason proably?

                Thanks
                Ernest

                  • 3749
                  • 24,544 Posts
                  Does the login form appear?

                  Is the user successfully logged in after submitting it?

                  Is resource 76 published?

                  Do you have any permissions set that would deny the user access to that resource?
                    Did I help you? Buy me a beer
                    Get my Book: MODX:The Official Guide
                    MODX info for everyone: http://bobsguides.com/modx.html
                    My MODX Extras
                    Bob's Guides is now hosted at A2 MODX Hosting
                    • 5393
                    • 63 Posts
                    Hi BobRay,

                    1. yes the login form appear
                    2. not sure about this part. coz after clicking submit button it just stay in the same page.
                    3. if I type the full path of resource 76 it will be published.
                    4. for 76 I set it for member only. that's why user have to log in first.

                    thx
                    ernest
                      • 5393
                      • 63 Posts
                      the html code for the login page is like that:

                       
                      <div class="loginForm">
                          <div class="loginMessage"></div>
                          <div class="loginLogin">
                              <form class="loginLoginForm" action="index.php?id=74" method="post">
                                  <fieldset class="loginLoginFieldset">
                                      <legend class="loginLegend"></legend>
                                      <label class="loginUsernameLabel">login.username
                                      <input class="loginUsername" type="text" name="username" />
                                      </label>
                      
                                      <label class="loginPasswordLabel">login.password
                                      <input class="loginPassword" type="password" name="password" />
                                      </label>
                                      <input class="returnUrl" type="hidden" name="returnUrl" value="" />
                                      
                                      <input class="loginLoginValue" type="hidden" name="service" value="login" />
                                      <span class="loginLoginButton"><input type="submit" name="Login" value=""/>                   </span>
                                  </fieldset>
                              </form>
                          </div>
                      
                      </div>