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

    I’ve been trying to use the Login Snippet. I have used and I know how a couple of snippets e.g. WayFinder ... and how they work so don’t worry I’m not new to the concept + I usually get my problems solved with the Modx Docs up until this point.

    I’ve checked out; http://rtfm.modx.com//display/ADDON/Login

    Which is the documentation for the Login Snippet and I’m trying to understand how exactly it works. The docs make a couple of assumptions ... lets’s start with the Login.Register Snippet ... there’s the example at this link;

    http://rtfm.modx.com/display/ADDON/Register.Example+Form+1

    I have a couple of questions about this example ...

    <div class="register">
        <div class="registerMessage">[[+error.message]]</div>
         
        <form class="form" action="[[~[[*id]]]]" method="post">
            <input type="hidden" name="nospam:blank" value="" />
             
            <label for="username">[[%register.username? &namespace=`login` &topic=`register`]]
                <span class="error">[[+error.username]]</span>
            </label>
            <input type="text" name="username:required:minLength=6" id="username" value="[[+username]]" />
             
            <label for="password">[[%register.password]]
                <span class="error">[[+error.password]]</span>
            </label>
            <input type="password" name="password:required:minLength=6" id="password" value="[[+password]]" />
             
            <label for="password_confirm">[[%register.password_confirm]]
                <span class="error">[[+error.password_confirm]]</span>
            </label>
            <input type="password" name="password_confirm:password_confirm=`password`" id="password_confirm" value="[[+password_confirm]]" />
             
            <label for="fullname">[[%register.fullname]]
                <span class="error">[[+error.fullname]]</span>
            </label>
            <input type="text" name="fullname:required" id="fullname" value="[[+fullname]]" />
             
            <label for="email">[[%register.email]]
                <span class="error">[[+error.email]]</span>
            </label>
            <input type="text" name="email:email" id="email" value="[[+email]]" />
             
            <br class="clear" />
             
            <div class="form-buttons">
                <input type="submit" name="registerbtn" value="Register" />
            </div>
        </form>
    </div>
    


    What’s [[%register.username? &namespace=`login` &topic=`register`]] and also [[+error.fullname]] .... for whoever will answer I’m not so much looking for what it does but I don’t understand what those types of tags are.

    Do you put the snippet code and the html code in the same resource?

    The &activationResourceId=`12` points to resource with id 12, in a totally different context what does this result to?

    Another thing that was not clear from the documentation is what fields are allowed into the user account in modx, is it just the usual or how exactly does the Register snippet work with modx, it was not clear how the data is captured ...

    Hope I’m not asking for too much smiley

    The best was to solve this would be to update the documentation and add a little more information especially on the detail about the small things...

    For Shaun (splittingred) ... I do appreciate your work. Really.
      • 23510
      • 168 Posts
      The [[%...]] are language tags and you can just replace them with static text.

      The 12 in &activationResourceId=`12` refers to a resource of your own that contains the ConfirmRegister tag.

      Not too sure about the custom fields as I’m having my own issues with that.
        • 14372
        • 49 Posts
        Thanks for your reply smiley Much appreciated!

        About the [[%]] ... any link that you can point me to so that I can learn a bit more on the language tags? Still clueless on the [[+.....]] ... can’t figure out what they are or where to learn more about this other than the docs

        *BUMP* :-(

        Hopefully the documentation will be updated to include a bit more information or another example.

        Also tried to install the modx sample site and try decipher how the Login snippets work but STILL it didn’t help because in the sample site the login isn’t ACTUALLY implemented :-(

        I’m at a dead end people...

          • 36575
          • 104 Posts
          Hi,

          Have you read this?
          http://modxcms.com/forums/index.php/topic,60982.0.html

          I followed this yesterday and have been able to install a login / register / profile etc on my site. I don’t actually UNDERSTAND it all, but it works smiley

          For things like the following:

          <label for="username">[[%register.username? &namespace=`login` &topic=`register`]]
          <span class="error">[[+error.username]]</span>
          </label>

          I didn’t change ANYTHING. The Username is a field in the backend, and the [[+error.username]] is not something I had to setup at all. It displays an error if you enter the data incorrectly but that all comes packaged in the package.

            • 14372
            • 49 Posts
            A MILLION THANK YOUs smiley

            Haven’t looked at the material in depth but just after skimming it I can tell that this is kind of what I was looking for. In fact the guy has written a small tutorial about it in PDF and keeps updating it!

            Awesome.

            Will work on it when I can and let you guys know how it goes.

            Thanks again, for your time smiley