[[!Login? &loginTpl=`lgnLoginTpl` &logoutTpl=`lgnLogoutTpl` &errTpl=`lgnErrTpl` &loginResourceId=`1` &logoutResourceId=`1`]] <div class="loginForm"> <div class="loginMessage">[[+errors]]</div> <div class="loginLogin"> <form action="[[~[[*id]]]]" method="post"> <fieldset> <input type="hidden" name="login_context" value="mgr" /> <input type="hidden" name="modahsh" value="{$modahsh|default}" /> <input type="hidden" name="returnUrl" value="{$returnUrl}" /> <legend class="loginLegend">[[+actionMsg]]</legend> <div class="form-group"><Input id="modx-login-username" type="text" name="username" placeholder="User ID" class="form-control" aria-required="true" required style="width:50%;" /></div> <div class="form-group"><input id="modx-login-password" type="password" name="password" placeholder="Password" class="form-control" aria-required="true" required style="width:50%;" /></div> <div class="form-group"><button class="btn btn-primary btn-block" type="submit" style="width:20%;">Log In</button></div> </fieldset> </form> </div> </div>
This question has been answered by arri_amira. See the first response.
[[!Login? &loginResourceId=[[++user_page]] ]]
It seems like what you're doing should work, but another way to do it is to have one dedicated login page for all users, then create a User Setting for each user called user_page containing the ID of the user's page.
In the login tag, do this:
[[!Login? &loginResourceId=[[++user_page]] ]]
That will redirect the user to their own page after a successful login if you have the permissions set correctly.
<input type="hidden" name="login_context" value="web" />
I found this in MODX Docs. It matches my proplem.
Login errors are not displayed
If you fingermash the keyboard with a non-existent username and try to login, sometimes you don't see any errors displayed.
I allways dont see any errors :,D The site is still reloading after i log-in with a user or non-user.
But how i get this script to work? I followed the tutorial in the docs..
[[!Login? &loginResourceId=[[++user_page]] ]]
Is the user page published?
Try deleting all files in the core/cache directory.
[[!Login? &tplType=`modChunk` &loginTpl=`myLoginChunk` &loginResourceId=`13` ]] <!-- BUT NOT THIS BELOW --> [[!Login? &tplType=`modChunk` &loginTpl=`myLoginChunk` &loginResourceId=`[[++user_page]]` ]]
<!-- THIS IS THE SCRIPT PLACED IN THE LANDING PAGE --> <a href="?id=[[++user_page]]" class="btn btn-primary">Take me to the Download</a>
<a href="[[~11? &service=`logout`]]" title="Logout" class="forgot">Logout</a>
[[!ForwardToUserPage]]
/* ForwardToUserPage Snippet */ $url = $modx->makeUrl([[++user_page]], "", "", "full"); $modx->sendRedirect($url);
<p style="padding:2pt;font-size:12pt;color:white;width:40%;height:75pt;background-color:rgb(200,200,200);">[[++user_comment]] </p>