Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I would really like to see an even simpler field type called 'Plain text' (probably using short values - varchar(255) for now) that we could easily extend for other field type like email, phone, and color to use for storage and default formatters. So rather than implementing all the hooks for each field, it would be nice to be able to do this:
// Note this is an overly simplified verison.
class FieldMail extends FieldPlainText {
public function getWidgetForm() {
$form = parent::getWidgetForm();
$form['value']['#type'] = 'mail';
return $form;
}
}
Comments
Comment #1
Stalski CreditAttribution: Stalski commentedTagging this for D9.
Personally, I am not sure if we need this most simple field. That said It is open for discussion.
Comment #2
catchFeatures can be added in minor releases.
Comment #3
swentel CreditAttribution: swentel commentedStringItem is now in core, so I guess we're done here.
Comment #4
Gábor HojtsyShould be duplicate and against 8.0.x, no?