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

    Two questions…

    1. I’m implementing a user login area with the "WebLogin" snippet, and I’m trying to set the page that is returned once a user logs in. I’d like it to be set to whatever page a person is viewing at the time they decide to login. For example, if they’re viewing a blog post, and decide to login to add comments to it, they’ll be returned to that SAME page. So the returned page will always be whatever page they were on when they login. So it’s never a default, but varies. Does that make sense?

    I think I have to modify something in one of the following files, but I’m not sure exactly what.

    …snippets/weblogin/weblogin.inc.php
    …snippets/weblogin/weblogin.processor.inc.php

    or modify this line of code
    [!WebLogin? &tpl=`FormLogin` &loginhomeid=`--what goes here?--`!]

    For this code, I probably want something other than "&loginhomeid", right?

    2. Also, I’d like to show the username once s/he logs in. Which value do I use? I’ve tried "[+username+]", "[+userid+]", and "[+uid+]". None of them work. This may be related to above files as well.

    Here’s the code I’ve been using:
    <p>Hi [+username+].<br />
    You're logged in.</p>
    <p><a href="[+action+]" title="[+logouttext+]">[+logouttext+]</a></p>


    Everything but "[+username+]" is displayed.

    Any ideas?
      • 36592
      • 970 Posts
      For the 2nd question, I’m using Personalize snippet, which is included in the default modx install.
      http://modxcms.com/forums/index.php/topic,25396.msg156279.html#msg156279
        • 4280
        • 22 Posts
        Yabba-dabba-do!  grin

        That forum post you linked to solved question 2. Thanks.

        Anybody got an answer for question 1?
          • 20413
          • 2,877 Posts
          If your users aren’t assigned login home pages in user-settings then leave out/use: &loginhomeid=`[~[*id*]~]`

          Try it!
            @hawproductions | http://mrhaw.com/

            Infograph: MODX Advanced Install in 7 steps:
            http://forums.modx.com/thread/96954/infograph-modx-advanced-install-in-7-steps

            Recap: Portland, OR (PDX) MODX CMS Meetup, Oct 6, 2015. US Bancorp Tower
            http://mrhaw.com/modx_portland_oregon_pdx_modx_cms_meetup_oct_2015_us_bancorp_tower
            • 4280
            • 22 Posts
            Completely removing "&loginhomeid=`[~[*id*]~]`" did the trick. Now once logged in you’re served the page you were originally on. Thanks!
              • 27442
              • 103 Posts
              Quote from: BuildIT at Mar 05, 2009, 02:15 PM

              Completely removing "&loginhomeid=`[~[*id*]~]`" did the trick. Now once logged in you’re served the page you were originally on. Thanks!
              And as long as that particular user doesn’t have a Login Home Page set in their webuser profile
                • 4280
                • 22 Posts
                Sure. And the only way that can happen is if the site admin sets a login homepage. Right? A user who signs up for an account can’t set what they want their login page to be... at least not by default.