We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 51020
    • 670 Posts
    Quote from: tm2000 at Apr 12, 2016, 09:59 AM
    Hi,

    I have a members area on my site, so I have used the Login Extra to handle user access and registrations. It works fine, but the only problem is that the members only pages aren't appearing in my Wayfinder call when the user is logged out - I understand why, but is there a way to enable then to view the menu items only? Then if a user tries to visit one of the members pages, it will redirect them to the login page.

    I can't find anything in the docs regarding this.

    Thanks!
    Andy


    Just with a standard Wayfinder call:

    [[Wayfinder?
    &startId=`0`
    &level=`2`
    &parentClass=`dropdown`
    &outerTpl=`outerTpl`
    &innerTpl=`innerTpl`
    ]]


      • 22840
      • 1,572 Posts
      Note very elegant but have you tried &includeDocs=`2,3,4,5` ect
        • 51020
        • 670 Posts
        Quote from: paulp at Apr 12, 2016, 10:35 AM
        Note very elegant but have you tried &includeDocs=`2,3,4,5` ect

        yes I tried that - it doesn't work.
        I think it's something to do with the resource groups set up - ie, you can Load,List,View etc?

        I wonder if I need to set up a public resource group, and just allow the user to Load and List?

        I have no idea when it comes to modx permissions though - I find the whole thing baffling!
          • 22840
          • 1,572 Posts
          Quote from: tm2000 at Apr 12, 2016, 10:40 AM
          Quote from: paulp at Apr 12, 2016, 10:35 AM
          Note very elegant but have you tried &includeDocs=`2,3,4,5` ect
          I have no idea when it comes to modx permissions though - I find the whole thing baffling!

          Your not alone there ;o)
            • 51020
            • 670 Posts
            OK I have sorted this a different way - instead of using Resource groups, I ave used a snippet on each template which is password protected, and that works fine.

            Final piece of the puzzle is the field names in the Register/Login Form.

            I don't want to use 'username and password' which sounds odd, but there is a good reason.
            The users all have an ID number, and an account number, and we want them to use those instead.

            So I have used this in my register snippet call:

            &usernameField=`Account number`
            &passwordField=`ID number`

            but this doesn't work - am I doing something wrong?

            Thanks!
            Andy
              • 46886
              • 1,154 Posts
              If I am not mistaken, what you can do is leave the snippet call with the default terminology. Then, change the *form language* so your users know what info to put in there. A little inelegant but much easier. The form is where you tell your users what rules there are for these values, the snippet call tells Modx what these fields are called, internally. It can be password internally and in the form be anything.

              But I do wonder (this is the register after all) how your users will know these values? The internal Modx user ID number will be generated when the form processes, not before, but you are going to have another number as well, called ID number?

              All you seem to be doing is requiring that the user name and password be limited to digits, which I do believe you will want to look at system settings about acceptable usernames and passwords. I think the default settings are not strict though, it might require 4 characters is all.

              HTH, my brain is not working at top speed at the moment.

              PS if you change any of the user data field names its going to be saved in a JSON file which is not the most efficient way. Usually people just repurpose things like fax number for their special user fields. Of course for you you still need to have a 'username' and 'password' value for logging in, the fax number can't do this job easily at least. This may also be why you are having trouble (only maybe), the system may require a value for username and for password, now with your code there is none it seems. If you want to have a lot of user data then you can look at the ClassExtender extra for Revo.
                • 51020
                • 670 Posts
                Quote from: nuan88 at Apr 13, 2016, 09:40 AM
                If I am not mistaken, what you can do is leave the snippet call with the default terminology. Then, change the *form language* so your users know what info to put in there. A little inelegant but much easier. The form is where you tell your users what rules there are for these values, the snippet call tells Modx what these fields are called, internally. It can be password internally and in the form be anything.

                But I do wonder (this is the register after all) how your users will know these values? The internal Modx user ID number will be generated when the form processes, not before, but you are going to have another number as well, called ID number?

                All you seem to be doing is requiring that the user name and password be limited to digits, which I do believe you will want to look at system settings about acceptable usernames and passwords. I think the default settings are not strict though, it might require 4 characters is all.

                HTH, my brain is not working at top speed at the moment.

                PS if you change any of the user data field names its going to be saved in a JSON file which is not the most efficient way. Usually people just repurpose things like fax number for their special user fields. Of course for you you still need to have a 'username' and 'password' value for logging in, the fax number can't do this job easily at least. This may also be why you are having trouble (only maybe), the system may require a value for username and for password, now with your code there is none it seems. If you want to have a lot of user data then you can look at the ClassExtender extra for Revo.


                Thanks for the detailed explanation.
                The user will understand the fields, as it will ask for the membership details which they already have offline.
                I tried playing with the form, and found that I can simply replace the [[%login.username]] with whatever I want - and this works OK!

                One other problem I am having though is that when the user registers, and clicks the activation link, they get a 404 error - but all the setup looks fine. Is this to do with me not using resource groups?

                I don't get it!

                Andy