User:Login_Form Tag

If you wan to build a login form for your users, this is the easiest way to do it.


User tags are designed for sites that have areas or features behind a login. The user:login_form tag helps you build that login form.

The tag will render the opening and closing <form> HTML elements for you. The rest of the form markup is up to you as long as you have an email and password input field.


{{ user:login_form }}

    {{ if errors }}
        <div class="bg-red-300 text-white p-2">
            {{ errors }}
                {{ value }}<br>
            {{ /errors }}
    {{ /if }}

    {{ if success }}
        <div class="bg-green-300 text-white p-2">
            {{ success }}<br>
    {{ /if }}

    <input type="text" name="email" value="{{ old:email }}" />

    <input type="password" name="password" value="{{ old:password }}" />

    <button type="submit">Log in</button>

{{ /user:login_form }}


redirect string

Where the user should be taken after successfully logging in.

error_redirect string

The same as redirect, but for failed logins.

allow_request_redirect boolean

When set to true, the redirect and error_redirect parameters will get overridden by redirect and error_redirect query parameters in the URL.

HTML Attributes

Set HTML attributes as if you were in an HTML element. For example, class="required" id="login-form".


Variable Type Description



An array of validation errors.



An array of previously submitted values.



A success message.

Betterify this page on Github!
Hello there! Are you looking for the Statamic v2 documentation?