diff --git a/core/profiles/demo_umami/themes/umami/templates/components/search/input--search.html.twig b/core/profiles/demo_umami/themes/umami/templates/components/search/input--search.html.twig deleted file mode 100644 index f93702fcce6f926ef4518d0dde6f7d7605af206f..0000000000000000000000000000000000000000 --- a/core/profiles/demo_umami/themes/umami/templates/components/search/input--search.html.twig +++ /dev/null @@ -1,18 +0,0 @@ -{# -/** - * @file - * Theme override for an 'input' #type form element. - * - * Available variables: - * - attributes: A list of HTML attributes for the input element. - * - children: Optional additional rendered elements. - * - * @see template_preprocess_input() - */ -#} - -{% - set placeholder_text = 'Search by keyword, ingredient, dish' -%} - -<input{{ attributes.setAttribute('placeholder', placeholder_text) }} />{{ children }} diff --git a/core/profiles/demo_umami/themes/umami/umami.theme b/core/profiles/demo_umami/themes/umami/umami.theme index 07749eb72645e0466507515a1ebe32beed48cfd9..4f744eaa6581c347ae3fedfbbec99f5d5c833a2a 100644 --- a/core/profiles/demo_umami/themes/umami/umami.theme +++ b/core/profiles/demo_umami/themes/umami/umami.theme @@ -5,6 +5,7 @@ * Functions to support theming in the Umami theme. */ +use Drupal\Core\Form\FormStateInterface; use Symfony\Cmf\Component\Routing\RouteObjectInterface; /** @@ -81,3 +82,10 @@ function umami_preprocess_breadcrumb(&$variables) { // "Home > Articles" on the Recipes page, which should read "Home > Recipes". $variables['#cache']['contexts'][] = 'url'; } + +/** + * Implements hook_form_FORM_ID_alter(). + */ +function umami_form_search_block_form_alter(&$form, FormStateInterface $form_state) { + $form['keys']['#attributes']['placeholder'] = t('Search by keyword, ingredient, dish'); +}