Add user on drupal pages
Drupal user account pages
Drupal Defaut's installation, user account can be really use some love and attention. Found a number be defined pages to allow user to register themselves in website, but applicability of page is pretty bad. This post is approximately a small sampling: all share they same title. I will show how you can fix.
See in drupal.org register, login and ask new password pages. You will notice each have one title head “user account | drupal.org", and a page title “user account". While respectively page of course have one different role, why will design get all ditto topics? Wicked ones just weird and medium applicability – a page title should descriptive of main function a page.
However, found ways to overcome. Drupal use one placeholder variable to dynamic determine head page and title based on internal route. In your theme, you will find something such as following:
<title><?php print $head_title ?></title>
And:
<h1><?php print $title ?></h1>
Since Drupal determines his context based on route requested, only examination to argument on passed to page is enough.
<h1><?php
if (arg(0) 'user' && arg(1) 'register') :
print t('Create new account');
elseif (arg(0) 'user' && arg(1) 'password') :
print t('Request new password');
elseif (arg(0) 'user' && arg(1) 'login') :
print t('Log in');
elseif (arg(0) 'user' && arg(1) '') :
print t('Log in');
else:
print $title;
endif;
?></h1>
It is really simple PHP, for first examination and second arguments (arg(0) and arg(1)). Note of printing out text, it packaged in t function, will make it translatable. That, you does not need edit theme in order to translate your texts then.
As you can see, found two examination to login page. Consumer and consumer as both / login page present a login page, and Drupal's menu presented in account page default to consumer page. So that we should check if second point vacate, and if it is not, print title login page. If we do not adding addition check, we will have been rejecting default consumer account page, all follow form consumer / uid, where uid is numerical id of consumer.
Just adding same examination in <head> title would complement to change it there also. Full credit left at Drupal's society, as bit is based on drupal.org. You can see it in action in CJP's website new: login, register and forgotten password.
Adding user from adminster : step 1
step 2:
- 172 reads
Recent popular content



















