Authentication

To trigger the plugin’s overlay pages you can use javascript functions. You can create a link to open the overlay pages by adding an onclick event.

onclick="mb.openOverlay('TYPE', event)"

Add the onclick event to a link element where TYPE is the overlay name. So the following example will create a link to open the login overlay.

<a href="#" onclick="mb.openOverlay('login', event)">
    Login here
</a>

The available overlay types are:

  • login
  • register
  • password
  • profile

To make sure that login and register links are only visible when a user is logged out, the class mbplugins-btn-auth should be added to the element.

To make sure that the profile link is only visible when a user is logged in, the class mbplugins-btn-profile should be added to the element.

For example, the following code will provide basic authentication functionality.

<li class="mbplugins-btn-auth">
  <a href="#" onclick="mb.openOverlay('login', event)">
    Login
  </a>
</li>
<li class="mbplugins-btn-auth">
  <a href="#" onclick="mb.openOverlay('register', event)">
    Register
  </a>
</li>
<li class="mbplugins-btn-profile">
  <a href="#" onclick="mb.openOverlay('profile', event)">
    My profile
  </a>
</li>

© Copyright 2019 - MBPLUGINS

Privacy policy