Modifying the labels in the login boxes

Permalink
Hi,

I'm trying to modify the "Username" and "Password" text in the login boxes on the login page and can't seem to find where to change this. Can anyone point me in the right direction?

Thanks,

btroyi

 
MrKDilkington replied on at Permalink Best Answer Reply
MrKDilkington
Hi wwwbtroyi,

To customize the login form labels, you need to override the login form:
- copy form.php
concrete\authentication\concrete\form.php
- paste form.php into application\authentication\concrete
application\authentication\concrete\form.php
- this line contains the "Username" text
<label class="control-label"><?=Config::get('concrete.user.registration.email_registration') ? t('Email Address') : t('Username')?></label>

- this line contains the "Password" text
<label class="control-label"><?=t('Password')?></label>
wwwbtroyi replied on at Permalink Reply
Thank you for answering, but I looked at the login single page code before posting and cannot find the source of the text in the login boxes. Is it a javascript? And if so where is it located? I need to change what shows in the boxes to be in compliance with another system.

Thanks,

btroyi
MrKDilkington replied on at Permalink Reply
MrKDilkington
@wwwbtroyi

I updated the instructions.
wwwbtroyi replied on at Permalink Reply
Do I need to modify the login.php page to get it to see the override? Here is the code that shows in the form.php (which doesn't show the same line you show in your example, however there is a similar line) and the single page login.php.

form.php original:
<?php defined('C5_EXECUTE') or die('Access denied.');
$form = Core::make('helper/form');
/** @var Concrete\Core\Form\Service\Form $form */
?>
<form method="post" action="<?php echo URL::to('/login', 'authenticate', $this->getAuthenticationTypeHandle()) ?>">
   <div class="form-group">
      <input name="uName" class="form-control col-sm-12" placeholder="<?php echo Config::get('concrete.user.registration.email_registration') ? t('Email Address') : t('Username')?>" autofocus="autofocus" />
   </div>
   <div class="form-group">
      <label> </label>
      <input name="uPassword" class="form-control" type="password" placeholder="<?php echo t('Password')?>" />
   </div>
   <div class="checkbox">
      <label style="font-weight:normal">
         <input type="checkbox" name="uMaintainLogin" value="1">


login.php original:
<?php
use Concrete\Core\Attribute\Key\Key;
use Concrete\Core\Http\ResponseAssetGroup;
defined('C5_EXECUTE') or die('Access denied.');
$r = ResponseAssetGroup::get();
$r->requireAsset('javascript', 'underscore');
$r->requireAsset('javascript', 'core/events');
$form = Loader::helper('form');
if (isset($authType) && $authType) {
    $active = $authType;
    $activeAuths = array($authType);
} else {
    $active = null;
    $activeAuths = AuthenticationType::getList(true, true);
}


My assumption is that I need to modify this line to point concrete to the override:
$form = Loader::helper('form');


Thank you for your help

wwwbtroyi
MrKDilkington replied on at Permalink Reply
MrKDilkington
@wwwbtroyi

Since you needed to modify the text inside the login form itself, and not the login page, I updated the override instructions.
surefyre replied on at Permalink Reply
surefyre
Trying to do this from a package... thought maybe <package>/authentication or <package>/application/authentication might work but no joy.

Can this be done?