3

Drupaliest way to remove login descriptions

http://drupal.org

I'm using version 7 alpha 3 and a custom theme based on seven.

What I want to do is remove the descriptions on the user/login page text fields.
For example, under the password field label it says:
Enter the password that accompanies your username.

I know a couple ways to do it:

  • css: color text same as background (yuck)
  • change the markup based on the name of the text field:
    code from form.inc function theme_form_element($variables)
    if (!empty($element['#description'])) { $output .= ' <div class="description">' . $element['#description'] . "</div>\n"; }
    change in my template.php mytheme_form_element($variables) to
    if ((!empty($element['#description'])) && ($element[#title] != "Password" ||  $element[#title] != "Username")) { $output .= ' <div class="description">' . $element['#description'] . "</div>\n"; }

But these aren't sound solutions (e.g., maybe I want other Username fields elsewhere to have descriptions).
What I really want is an empty $element['#description'] for the user/login form text fields.

I know where these are defined.
It's in user.module
function user_login($form, &$form_state)
on lines 1816 and 1819 (again, I'm using Drupal 7 alpha 3).

read more

Read »
Created by david_normaan 2 years 8 weeks ago
Category: News   Tags:

PSD to Drupal Theme

Drupal Development

Module Development

Get an Estimate

Tags for Drupaliest way to remove login descriptions

Recent comments