<?php use Drupal\comment\CommentInterface; function custom_drupal_overrides_field_widget_form_alter(&$element, &$form_state, $context) { if ($context['widget']->getPluginId() == 'entity_reference_autocomplete') { if ($element['target_id']['#maxlength'] == 1024) { $element['target_id']['#maxlength'] = 3072; } } if ($context['widget']->getPluginId() == 'entity_reference_tree') { if ($element['target_id']['#maxlength'] == 1024) { $element['target_id']['#maxlength'] = 3072; } } }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter