Visitor Documentation

Login — Zoo Visitor documentation

Login

{if logged_in}

        You are already registered and logged in.

{if:else}

        {exp:visitor:login_form return="visitor_example/profile"}

                <p>
                        <label for="email">Email:</label>
                        <input type="text" name="username" id="username" />
                </p>
                <p>
                        <label for="password">Password:</label>
                        <input type="password" name="password" id="password" />
                </p>

                {if auto_login}
                <p>
                        <label for="remember_me">Remember me?</label>
                        <input class='checkbox' type='checkbox' name='auto_login' value='1'  />
                </p>
                {/if}

                <input type="submit" name="submit" value="Log in" />

        {/exp:visitor:login_form}

{/if}

Login

{exp:visitor:login_form}

Login tag variables

error_handling

Default off, set to “inline” to enable inline error handling. When using inline error handling, {error:login} will return the errors.

id

css id of the form

class

css class of the form

return

Template where the member will be redirected when login is successful

json

Default no, set to “yes” the form will output your results in JSON format, instead of performing a redirect. Use this setting when constructing an AJAX login form.

secure_action

Forces the form to use https as its action.. Yes/No Defaults to “no”.

secure_return

Force the form to return to https. Yes/No Defaults to “no”.

Login form example

Regular login form

{exp:visitor:login_form return="account/profile" error_handling="inline"}
{error:login}
Email: <input id="username" name="username" type="text" />
Password: <input id="password" name="password" type="password" />
{if auto_login}
Remember me? <input class="checkbox" name="auto_login" type="checkbox" value="1" />
{/if}
<input name="submit" type="submit" value="Log in" />
{/exp:visitor:login_form}

AJAX login form

Check the included sample template

Support

Having problems setting up and/or using Visitor? Support is offered from 10am to 4pm EST weekdays. Send us an email at help@eeharbor.com and we will respond as quickly as we can.