We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 25308
    • 46 Posts
    Quote from: odeclas at Apr 01, 2011, 10:20 AM

    Don’t bother with Profile for now - just add [[+modx.user.username]] somewhere on the page and it will display the currently logged in user.

    sorry I charged ahead before I saw your reply. Here’s what I did.

    It’s a head scratcher. It seems that my confirm registration link is logging the user into the system for some reason.

    To test this out I added a link to my update profile page, my user home page and the login page. (The first two shouldn’t even be able to be accessed unless logged in. I’ve tried before and that works.)

    On my user update page I included the profile snippet call to display who is logged in just to test if I was. It showed the test user name that I was activating before I tried to login.

    I’m fine with this,... It’s just not what I expected. Well I’m fine with it unless you know of a reason this could be detrimental. You would know better than I. Thank you for your help!!
      • 22019
      • 390 Posts
      Hmm. I’ve just tried this on one of my sites, and yes, it logs you in on activation. I hadn’t noticed before as I have a login box on every page - which has already rendered by the time the activation happens.

      One minor amend to what I wrote earlier - use this instead
      [[!+modx.user.username]]


      You need to call it uncached (the exclamation mark), otherwise it will remember the previous user.
        Writer > E-consultant > MODx developer || Salesforce || modx 2.x || PHP 5.2.13 || MySQL client 5.0.86
        • 25308
        • 46 Posts
        Quote from: odeclas at Apr 01, 2011, 10:37 AM

        Hmm. I’ve just tried this on one of my sites, and yes, it logs you in on activation. I hadn’t noticed before as I have a login box on every page - which has already rendered by the time the activation happens.

        One minor amend to what I wrote earlier - use this instead
        [[!+modx.user.username]]


        You need to call it uncached (the exclamation mark), otherwise it will remember the previous user.

        ah. ok. Can you explain the difference between the [[!+modx.user.username]] call and the [[!profile]] w/ [[+username]] call? Do they achieve the same thing or do they have different times they are used?
          • 22019
          • 390 Posts
          [[!+modx.user.username]] is just quicker and simpler, that’s all. Swings and roundabouts really, but the underlying table structure has the profile as a separate table, so it’s marginally quicker and more efficient that way.
            Writer > E-consultant > MODx developer || Salesforce || modx 2.x || PHP 5.2.13 || MySQL client 5.0.86
            • 25308
            • 46 Posts
            Quote from: odeclas at Apr 01, 2011, 10:56 AM

            [[!+modx.user.username]] is just quicker and simpler, that’s all. Swings and roundabouts really, but the underlying table structure has the profile as a separate table, so it’s marginally quicker and more efficient that way.

            That makes sense. Thanks for the tip. grin

            Odeclas, I can’t even begin to thank you. You’ve been a tremendous help! I’d still be spinning my wheels if not for you. Now the system works and all is well with the world. Now I just have to figure out which direction to move in my other post. I really like throwing some curve balls don’t I? grin grin grin
              • 14372
              • 49 Posts
              Hey, quick question ... I was able to get the entire registration thing going but I also have a problem with handling, selects, checkboxes and radios? Any ideas so far?

              FormIt does it so well though.
                • 14372
                • 49 Posts
                Hey guys I think I nailed it ... haven’t tried it thought but I’m 90% sure that this will work...

                [[+name:default=`anonymous`]]


                +name is the placehoder with the default/ifempty/empty output modifier and the default value ’anonymous’

                I found this idea here ... http://rtfm.modx.com/display/revolution20/Input+and+Output+Filters+(Output+Modifiers)
                  • 25308
                  • 46 Posts
                  Quote from: itsmrwave at Apr 12, 2011, 03:57 AM

                  Hey, quick question ... I was able to get the entire registration thing going but I also have a problem with handling, selects, checkboxes and radios? Any ideas so far?

                  FormIt does it so well though.

                  Hi, I haven’t had the pleasure of working with the check boxes and radios yet with the Login/ registration snippet. I have used a selector function though. I’m pretty sure they work pretty much like regular html form pieces wrapped in label tags.

                  My selector filed:
                    <label>Would you like to receive promotions on special deals? <span class="error">[[+error.notifications]]</span> <br />
                      <select name="promotions">
                     <option value="yes">Yes</option>
                     <option value="no">No</option>
                  </select></label>


                  Since the example above doesn’t have the typical value="[[+example]]", I had to figure out how to call the output. I’m thinking that all of the form fields use the "select name" attribute as the output for the form field. The info pulls up just fine with a [[+promotions]] call.

                  If I run into any examples of the other two I’ll definitely send them your way. I’m guessing that a typical html form field will work fine. (it mentions that in the login documentation somewhere) Let me know how your experiment turns out. grin

                    • 14372
                    • 49 Posts
                    My experiment failed miserably! smiley Figured that its an OUTPUT FILTER which means it modifies what was already there into a certain formatted output, my-bad. And the problem is that we can’t get anything in, in-the first place.

                    But ... I thank you for your help ... your advice on selects WORKED! so for now atleast I can make all my options selects until a better solution comes up.

                    However I submitted this problem as an improvement in http://bug.modx.com, see here http://bugs.modx.com/issues/4365
                      • 25308
                      • 46 Posts
                      Quote from: itsmrwave at Apr 12, 2011, 09:06 AM

                      My experiment failed miserably! smiley Figured that its an OUTPUT FILTER which means it modifies what was already there into a certain formatted output, my-bad. And the problem is that we can’t get anything in, in-the first place.

                      But ... I thank you for your help ... your advice on selects WORKED! so for now atleast I can make all my options selects until a better solution comes up.

                      However I submitted this problem as an improvement in http://bug.modx.com, see here http://bugs.modx.com/issues/4365

                      Can I ask what your intended end result is? Is it just to add the radios and check boxes to your registration form? I think I’ve been down the road you’re on recently but you like to make sure I don’t waste your time with advice that doesn’t apply to your need.