I’ve been trying to add a register button after the login button and before the "Forget Your Password" text, but cannot seem to make it work. I cannot even find where the login button resides and I’ve been through every image directory I can find. Can anyone shed some light as to how to add the button?
-
☆ A M B ☆
- 24,524 Posts
Which version of MODx? What login snippet are you using? This is MODx; there are usually half-a-dozen ways (at least) to do something; we’ll need to know which one you’re using
Normally you use a chunk for the form e.g. [!WebLogin? &tpl=`FormLogin` &loginhomeid=`[(site_start)]`!]
Then just add the registration link to the chunk.
-
☆ A M B ☆
- 24,524 Posts
Creating your own form tpl isn’t php, it’s just HTML. Take the default login form tpl, copy it to a chunk and name it what you want; myForm for example. Then in the weblogin snippet, put &tpl=`myForm`. Check to make sure it still works exactly as it did. Then you can edit the form as you like, adding a link or button to the registration page.
Here’s the default WebLogin form - it’s just HTML, with some specified HTML elements to act as separators for the various parts; WebLogin knows which part to display. You would add your link to the registration page in the first section, the "login form section".
<!-- #declare:separator <hr> -->
<!-- login form section-->
<form method="post" name="loginfrm" action="[+action+]" style="margin: 0px; padding: 0px;">
<input type="hidden" value="[+rememberme+]" name="rememberme" />
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td><b>User:</b></td>
<td><input type="text" name="username" tabindex="1" onkeypress="return webLoginEnter(document.loginfrm.password);" size="8" style="width: 150px;" value="[+username+]" /></td>
</tr>
<tr>
<td><b>Password:</b></td>
<td><input type="password" name="password" tabindex="2" onkeypress="return webLoginEnter(document.loginfrm.cmdweblogin);" style="width: 150px;" value="" /></td>
</tr>
<tr>
<td><label for="chkbox" style="cursor:pointer">Remember me: </label></td>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="top"><input type="checkbox" id="chkbox" name="chkbox" tabindex="4" size="1" value="" [+checkbox+] onclick="webLoginCheckRemember()" /></td>
<td align="right">
<input type="submit" value="[+logintext+]" name="cmdweblogin" /></td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="2"><a href="#" onclick="webLoginShowForm(2);return false;">Forget Password?</a></td>
</tr>
</table>
</td>
</tr>
</table>
</form>
<hr>
<!-- log out hyperlink section -->
<a href='[+action+]'>[+logouttext+]</a>
<hr>
<!-- Password reminder form section -->
<form name="loginreminder" method="post" action="[+action+]" style="margin: 0px; padding: 0px;">
<input type="hidden" name="txtpwdrem" value="0" />
<table border="0">
<tr>
<td>Enter the email address of your account <br />below to receive your password:</td>
</tr>
<tr>
<td><input type="text" name="txtwebemail" size="24" /></td>
</tr>
<tr>
<td align="right"><input type="submit" value="Submit" name="cmdweblogin" />
<input type="reset" value="Cancel" name="cmdcancel" onclick="webLoginShowForm(1);" /></td>
</tr>
</table>
</form>