New answers tagged hooks
0
votes
How to change the title and add a placeholder to password and confirm password field through hook_form_alter?
Code to Alter pass & confirm pass field title along with password strength indicator display: Drupal(8/9/10)
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Render\Element\PasswordConfirm;...
0
votes
How can I hide a specific region according to its url?
You can use hook_preprocess_page() hook (.modue/.theme file) to hide footer region conditionally:
function Mymodulename_preprocess_page(&$vars) {
$vars['display_footer_region'] = true;
$...
0
votes
How to access and change a form's display mode in hook_form_alter() or similar?
There ought to be a method to get this analogous to $form_state->getFormObject()->getOperation() but I am not aware of one. You can fallback to getting the form display mode from the query ...
2
votes
How do I replace hook_field_widget_WIDGET_TYPE_form_alter() with hook_field_widget_complete_WIDGET_TYPE_form_alter()?
hook_field_widget_WIDGET_TYPE_form_alter() is replaced by hook_field_widget_single_element_WIDGET_TYPE_form_alter().
See the change record Streamline Field Widget Hooks.
It's not replaced by ...
0
votes
How do I replace hook_field_widget_WIDGET_TYPE_form_alter() with hook_field_widget_complete_WIDGET_TYPE_form_alter()?
It took hours to figure out because the extent to which your code needs to change is not documented anywhere I could find. I had to painstakingly parse through the data and cobble together the ...
Top 50 recent answers are included
Related Tags
hooks × 26717 × 877
8 × 538
theming × 411
nodes × 288
forms × 282
views × 258
entities × 220
users × 184
routes × 113
blocks × 83
6 × 83
webforms × 70
commerce × 61
database × 54
javascript × 51
taxonomy-terms × 46
navigation × 46
files × 43
9 × 43
ajax × 42
media × 37
emails × 34
search × 33
caching × 27