Skip to main content

mbr_login_form

Usage

This shortcode returns a HTML form through which a visitor can log in to the site.

Note

This shortcode provides optional parameters redirect and redirect_to_referrer that allow a redirection after a successful login either to a URL of choice or to that of the page which referred the visitor to where the [mbr_login_form] shortcode is used.

The use of either overrides the Redirect on login settings specified in ActiveMember360, Settings, Memberships.

Some examples of when redirect_to_referrer could be used are:

  • When enforcing a login to your site, as defined within ActiveMember360, Settings, Login, Always require login and if your login page as defined within ActiveMember360, Settings, Special Pages, Select your login page uses the [mbr_login_form] shortcode with the redirect_to_referrer parameter set to yes, after a successful login the user will be redirected to the URL that sent them to the login page.

  • When you have a 404 page that uses the [mbr_login_form] shortcode with the redirect_to_referrer parameter set to yes whoever is redirected to that 404 page, e.g. if they don't satisfy the access settings to another page, will be redirected back to that other page after a successful login on the 404 page.

Parameters

ParametersDescription
labelThe field label position.
Permissible Values: top, left, placeholder
Default: top
Required: no.
label_loginThe label for the username field.
Default: Log In
Required: no.
label_usernameThe label for the username field.
Default: Username or Email
Required: no.
label_passwordThe label for the username field.
Default: Password
Required: no.
label_rememberThe label for the username field.
Default: Remember Me
Required: no.
form_idThe HTML id attribute to apply for the login form.
Default: loginform
Required: no.
redirectThe URL to redirect the user to after a successful login.
Default: As specified in ActiveMember360, Settings, Memberships.
Required: no.
redirect_to_referrerRedirect the user after a successful login to the referrer URL if they have been automatically redirected from there to the page where this [mbr_login_form] shortcode is used. This will override the redirect parameter but only where the user has been referred.
Permissible Values: true, yes, 1
Default: no.
Required: no.
force_displayAlways display the login form irrespective of the visitors login status.
Permissible Values: true, yes, 1
Default: no.
Required: no.

Validity

This shortcode is evaluated for any type of visitor.

Conditional Branching

This shortcode does NOT support conditional branching with [ELSE_login_form].

Nesting

Shortcode nesting is NOT supported.

Examples

Generates a login form that is displayed when the visitor is not logged in to the site. After a successful login the user is redirected to the applicable Redirect on login setting as specified in ActiveMember360, Settings, Memberships:

[mbr_login_form]

API

Note

There is currently no ActiveMember360 API function equivalent for this shortcode.