I have a content type "consultation" that has an inline entity reference to 1 node of a content type "prescription". This content type prescription has multiple inline entity references to the content type "medecine".
I'm using the module Inline Entity Form so I create/add all of these nodes in the creation form of "consultation".
I'm trying to change the text "Add new node" in the form to something else. I know how to do this when it's a direct entity reference, but how do I get to the "Add new medecine" for "medecine"?
This is my code so far:
function node_change_form_alter(&$form, $form_state, $form_id) {
switch ($form_id) {
case 'consultation_node_form':
$form['field_prescription_med']['und']['actions']['ief_add']['#value'] = t('Add new medecine');
$form['field_prescription_med']['und']['form']['#title'] = t('Add new medecine');
$form['field_prescription_med']['und']['form']['actions']['ief_add_save']['#value'] = t('Add new medecine');
break;
}}
In this code:
- field_prescription is the name of the entity reference field in "consultation" (to a "prescription")
- field_prescription_med is the name of the entity reference field in "prescription" (to "medecine")