MENU

Front End Users one field login form

  Previous article Next article  

To enter a protected area at your website using the Front End Users module you need a login name and password. Sometimes it is more convenient to have just one field.

  How to use

I will describe two methods. Choose the one which suits you the most...
In both cases one of the form fields is pre filled in and is hidden so only one field is visible to the visitor.

A. Let all users log in with just one "password".

Create in the Front End Users Admin page a new user named i.e. "FEUser" and fill in the password you want to use.

Open in Design Manager the "FrontEndUsers::login form" and change this line:

<input type="{if $username_is_email}email{else}text{/if}" id="feu_username" name="{$fldname_username}" value="{$username}" size="{$username_size}" maxlength="{$username_maxlength}" {if !$username_is_email}autocorrect="off" autocapitalize="off"{/if} required/>

into:

<input type="hidden" id="feu_username" name="{$fldname_username}" value="FEUser" style="display: none" required />

What I do here is giving the username field a default value and afterwards hide it!
By changing the template and using CSS you can hide the fields and labels you don't want to show.

B. Give each user his/her own login name.

Create in the FEU Admin page a few users and use the same password each time, i.e. "DefaultPassword".

Open in Design Manager the "FrontEndUsers::login form" and change this line:

<input type="password" id="feu_password" name="{$fldname_password}" value="{$password}" size="{$password_size}" maxlength="{$password_maxlength}" required/>

into:

<input type="hidden" id="feu_password" name="{$fldname_password}" value="DefaultPassword" size="{$password_size}" maxlength="{$password_maxlength}" style="display: none" required />

What I do here is giving the password field a default value and afterwards hide it!
By changing the template and using CSS you can hide the fields and labels you don't want to show.




  Comment Form

Click here to open the form


  0 Comments

No comments yet...

CMS Made Simple - Tutorials, tips and tricks - CMSMS

Front End Users one field login form

  Article optimized for CMSMS 2.x

  Author:
  Last tested in: CMSMS 2.2.7
  Last updated: 31-03-2018
  Comments: 0
  http://cms.ms/cpUb

Advertisement



Ads help me to help you! Thanks!

Ads help me to help you! Thanks!

Ads help me to help you! Thanks!