We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 30043
    • 9 Posts
    I’m a new Modx user and have recently been hired to maintain a non-profit organization’s website. They have just suggested that I add a "Staff Area" where staff members can log in, view documents specific to staff members only, and communicate with each other (employees are located world-wide) via a forum of some sort.

    I’m just a bit lost right now as to how to create the "logging in" page. How do I create that page and grant permission to specific people (staff members only)?

    I’d truly appreciate any advice... remember, I’m a newbie... ease up on the technical vocabulary!
      • 1343 ☆ A M B ☆
      • 2,213 Posts
      Hello Timothy,

      Could you please tell us what version of MODx you are using so we can give more specific directions?

      Thanks
        Patrick | Server Wrangler
        About Me: Website | Tweets |  MODX Hosting
        • 28042 ☆ A M B ☆
        • 24,524 Posts
        In case you don’t know, the version should be in the upper right corner of the Manager (at least it is for Evolution 1.0.x).
          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
          • 30043
          • 9 Posts
          I am currently using MODx version 1.0.4.
            • 28042 ☆ A M B ☆
            • 24,524 Posts
            You’ll need to use the "Security" section of the Manager menu. First, go to "Web Permissions" and create a web group for the users ("Staff"), a resource group for their private resources ("Staff Pages"), and join them, using the three tabs in the Web Permissions page.

            Now create the web users for the staff members. If you want, use the User tab and assign them to a specific page to go to when they log in (a Staff "home" page, maybe?) Assign them to the new web group you just created.

            And finally, create the private resources for staff members and assign them to the resource group you created.

            Now, only web users who are logged in and belong to the group you associated with the resource group in step one will be able to see their pages. Wayfinder also respects this, so only these logged-in users will see the menu options.

            Use the WebLogin snippet to let users log in. You can customize the login form by using a chunk as the login form template and specifying the chunk name in the WebLogin snippet parameters. Just make sure to call the WebLogin snippet uncached ([!WebLogin...!] so it works properly.
              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
              • 30043
              • 9 Posts
              Sottwell: Thank you so very much! I got through most of this with no problems, but am stuck on the last paragraph you wrote.

              I added myself as a user, received the email with my username and password, but when I log into the site, nothing happens (the login form on the webpage is reset, I’m not brought to the staff "home page" that I had told it to go to).

              I think my problem is not understanding the last part of your post:

              "Use the WebLogin snippet to let users log in. You can customize the login form by using a chunk as the login form template and specifying the chunk name in the WebLogin snippet parameters. Just make sure to call the WebLogin snippet uncached ([!WebLogin...!] so it works properly."

              Currently, I’m using a chunk directly on the page. I guess this isn’t correct? What do you mean by specifying the chunk name into the snippet parameters?
                • 28042 ☆ A M B ☆
                • 24,524 Posts
                Use the WebLogin snippet, and in its parameters tell it to use the chunk as its tpl. The whole thing has to be generated by the WebLogin snippet.

                [!WebLogin? &tpl=`chunk-name`!]


                A good idea is to just use a plain [!WebLogin!] call so it uses its default tpl (it will probably not look like what you want), just to make sure it works. Then copy the deafault tpl into your chunk, use the &tpl parameter in the snippet call, and check to make sure it still works (it should look exactly the same). Then begin editing the chunk, checking after each change, until you get what you want.

                MODx comes with a chunk to use for a smaller sidebar login block you can use if you like.
                  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
                  • 30043
                  • 9 Posts
                  Okay. I have the WebLogin snippet open (the one that MODx had there already), and clicked on the Properties tab to access template text area. Is this where I write chunk name (WebLoginSidebar)? or the code that you wrote ([!WebLogin? &tpl=’chunk-name’!])?

                  Right now I have the WebLogin template code written directly onto the webpage. It gives me the look of where one could log in, but obviously, once I type in my username and password, it does nothing, because I don’t think I’ve told it what to do next. I thought I had defined the staff home page already, but obviously I’ve done something wrong.

                  Remember to dumb down the vocab... I’ve used MODx for just three weeks now, and am still very much lost. sad

                  It seems so simple, yet I’m so frustrated that I can’t seem to figure it out.
                    • 28042 ☆ A M B ☆
                    • 24,524 Posts
                    Just put the snippet tags [!WebLogin? &tpl=`chunk-name`!] in your page where you want the login form to appear.

                    Please note that those are NOT single-quotes ’...’ but backticks `...`

                    You can go to my manager (link in my sig) and login, and take a look at the Articles page "Sessions" code to see how I used a similar (more advanced) login snippet.

                    [!WebLoginPE? &loginFormTpl=`WebLogin` &successTpl=`LoginSuccess` &disableServices=`register,forgot,profile`!]
                      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
                      • 30043
                      • 9 Posts
                      It works! It works!! smiley

                      Thank you so so so very much... smiley smiley smiley