diff --git a/modules/custom/az_publication/az_publication.module b/modules/custom/az_publication/az_publication.module index ffd985d2a7..31b61d40da 100644 --- a/modules/custom/az_publication/az_publication.module +++ b/modules/custom/az_publication/az_publication.module @@ -302,9 +302,19 @@ function az_publication_preprocess_views_view(&$variables) { if (!empty($variables['id'])) { // Only run for publication search. if ($variables['id'] === 'az_publications') { - // Allow the publication year field to shrink if present. + // Reduce the width of the text input form elements from the default. + $allow_shrink = [ + 'name', + 'title', + ]; + foreach ($allow_shrink as $element) { + if (!empty($variables['exposed'][$element])) { + $variables['exposed'][$element]['#size'] = 20; + } + } + // Year field doesn't need a standard width text field. if (!empty($variables['exposed']['field_az_publication_date_value'])) { - $variables['exposed']['field_az_publication_date_value']['#wrapper_attributes']['class'][] = 'flex-shrink-1'; + $variables['exposed']['field_az_publication_date_value']['#size'] = 6; } if (!empty($variables['exposed']['field_az_publication_type_value'])) { // Add class so publication type select is styled like text inputs. diff --git a/modules/custom/az_publication/templates/views-exposed-form--az-publications.html.twig b/modules/custom/az_publication/templates/views-exposed-form--az-publications.html.twig index 79aedf0084..6519490f79 100644 --- a/modules/custom/az_publication/templates/views-exposed-form--az-publications.html.twig +++ b/modules/custom/az_publication/templates/views-exposed-form--az-publications.html.twig @@ -16,6 +16,6 @@ #} {{ q }} {% endif %} -
+
{{ form }}