- Issue created by @Katy Jockelson
- 🇮🇳India shailja179 India
Hi Katy Jockelson,
Which tooltip text you are referring to? Are you talking about Select the content types to exclude from the search index.
?Please elaborate in steps.
- 🇺🇸United States Katy Jockelson
On the front-end. "Enter the terms you wish to search for". See screenshot.
- Assigned to shailja179
- Status changed to Needs work
over 1 year ago 5:57am 19 April 2023 - Status changed to Needs review
over 1 year ago 6:17am 19 April 2023 - 🇮🇳India shailja179 India
function MYMODULE_form_alter(&$form, &$form_state, $form_id) { if ($form_id == 'search_block_form') {dump($form['keys']['#attributes']['title']); //To edit $form['keys']['#attributes']['placeholder'] = t('Placeholder text'); //To hide $form['keys']['#attributes']['placeholder'] = t(''); } }
There is no setting to edit it. But you can do it in custom module using this code.
- Issue was unassigned.
- 🇮🇳India Raveen Kumar
@Katy,
1) Is there any way to edit the tooltip text?
Solution:- The search box in Drupal is implemented using the Search module. You can modify the tooltip text by creating a custom module and implementing a hook to alter the search form. Please See attached for edit (changetext.png)2) Is there any way to hide it altogether?
Solution:- Yes, you can hide the tooltip text for the search box in Drupal by modifying the HTML attributes of the search form element by creating a custom module and implementing the hook_form_alter() hook to modify the title attribute of the search form element. By setting the title attribute to an empty string, the tooltip text will not be displayed. (Please see attached for hiding (hidetext.png)Let me know if you have still any queries. Please & Thank You.