A Login Form on Any Page

Applies to: Jamroom 7.0+ Last verified: 2026-10-24
  • The easy way

    On a Site Builder page, add the User Login and Signup widget. See Adding a New Widget.

  • In a template

    A login form needs a form token from {jrCore_form_create_session}, and is sent with jrFormSubmit():

    {jrCore_module_url module="jrUser" assign="uurl"}
    {jrCore_form_create_session module="jrUser" option="login" assign="token"}
    <div id="jrUser_login_msg" class="page_notice form_notice" style="display:none"></div>
    <form id="jrUser_login" name="jrUser_login" action="{$jamroom_url}/{$uurl}/login_save" method="post" accept-charset="utf-8" enctype="multipart/form-data">
        <input type="hidden" name="jr_html_form_token" value="{$token}">
        <input type="hidden" name="user_remember" value="on">
        <input type="text" class="form_text" id="user_email_or_name" name="user_email_or_name" placeholder="user name or email">
        <input type="password" class="form_text" id="user_password" name="user_password" placeholder="password">
        <button type="button" class="form_button" onclick="jrFormSubmit('#jrUser_login','{$token}','ajax');">log in</button>
    </form>
  • Messages, such as a wrong password, appear in jrUser_login_msg.

  • Skin login and signup pages

    The full login page is the Users module's user_login.tpl; Elastic 2 has its own as jrUser_user_login.tpl, with the signup and forgot password links, and the captcha when there is one. Copy it as a start. Signup works the same way, with option="signup" and signup_save: see jrUser_user_signup.tpl.

    Skin login and signup templates are only used when Enable Templates is on in the Users module's Global Config.

Tags