Error message

User warning: The following theme is missing from the file system: responsive_green. For information about how to fix this, see the documentation page. in _drupal_trigger_error_with_delayed_logging() (line 1143 of /var/www/moscovie.com/includes/bootstrap.inc).

Add new comment

Изменяем форму в виджете поля Drupal7

function MYMODULE_field_widget_form_alter(&$element, &$form_state, $context) {
// If this is an image field type
if ($context['field']['type'] == 'image') {
// Loop through the element children (there will always be at least one).
foreach (element_children($element) as $key => $child) {
// Add the new process function to the element
$element[$key]['#process'][] = 'MYMODULE_image_field_widget_process';
}
}
}

function MYMODULE_image_field_widget_process($element, &$form_state, $form) {
// Change the title field to a textarea
$element['title']['#type'] = 'textarea';

// Return the altered element
return $element;
}

Категория: 
The code has been tested and works
Мультитег: 

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.