mbr_login_form
Usage
This shortcode returns a HTML form through which a visitor can log in to the site.
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
Parameters | Description |
---|---|
label | The field label position. Permissible Values: top, left, placeholder Default: top Required: no. |
label_login | The label for the username field. Default: Log In Required: no. |
label_username | The label for the username field. Default: Username or Email Required: no. |
label_password | The label for the username field. Default: Password Required: no. |
label_remember | The label for the username field. Default: Remember Me Required: no. |
form_id | The HTML id attribute to apply for the login form. Default: loginform Required: no. |
redirect | The URL to redirect the user to after a successful login. Default: As specified in ActiveMember360, Settings, Memberships. Required: no. |
redirect_to_referrer | Redirect 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_display | Always 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
- Example 1
- Example 2
- Example 3
- Example 3
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]
Generates a login form that is always displayed irrespective of the visitors login status. After a successful login the user is redirected to the applicable Redirect on login setting as specified in ActiveMember360, Settings, Memberships:
[mbr_login_form force_display='yes']
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 URL 'http://mysite.com/mypage/':
[mbr_login_form redirect='https://mysite.com/mypage/']
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 back to the URL that referred them to the page where the login form is displayed. If there was no referral they will be redirected after a successful login to the applicable Redirect on login setting as specified in ActiveMember360, Settings, Memberships:
[mbr_login_form redirect_to_referrer='yes']
API
There is currently no ActiveMember360 API function equivalent for this shortcode.