I'm very new to Drupal development and I am completely stuck(.
I have a custom content form, where I need to hide some fields in Inline Entity Form. I am trying to write my own custom module to achieve this, I am doing the following: 1. I create module folder, where I put info.yml file 2. I create Controller file, where I add custom class and this code inside this class:
public function MY_MODULE_form_alter(&$form, FormStateInterface $form_state, $form_id) {if ($form_id == 'MY_FORM') {...};
- The next thing I am completely stuck at is do I need a routing file to make this work? I can't find any info about this so I'd really appreciate some help! And if I need routing, what should I write there?
hook_form_alter
work, I suggest you find a simple tutorial or example and start with that. Look here befused.com/drupal/form-alter or drupal.stackexchange.com/questions/163607/… start with anyone of those and make it work before diving into your problem. Than post a question with something more specific and your relevant code.inline_entity_form