I see from the api and various posts that I can identify a specific form to change using hook_form_alter, like this: hook_form_FORM_ID_alter()
From experience, I know this can be done in the .theme file along these lines...
function MYTHEME_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) {
if($form_id == 'node_pm_form' || $form_id == 'FORMIDHERE') {
$form['actions']['submit']['#value'] = t('Send');
}
But I have a form that occurs on different node types and I want to change the submit button label based on the node type.
I tried renaming the function like this...
function MYTHEME_form_alter__NODETYPE
and MYTHEME_form_alter__NODETYPE__full
That didn't work. I'm thinking form_alter just doesn't accept node type in the function name, so I need some logic in the code to check for node type and condition results on that. But I don't yet know how to write that.
I forgot to mention: the node edit form ID's in my theme include the content type. But I want to alter the comment edit form based on what node type replying to. And all my comment forms have the same id.