0

I have a custom field plugin. It's widget looks somewhat like this:

function mymodule_field_widget_form(&$form, &$form_state, $field, $instance, $langcode, $items, $delta, $element) {

...

      $main_widget = $element + array( 

        '#test' => 'test',
        '#type' => 'textarea',  
        '#attributes' => array('item_capacity' => 3), 
        '#theme'=>'mymodule_theme'

      );

...

}

I need to get a value of another field, attached to current node, and pass it to this widget's theme file. Can i somehow get at least an id of a node that contains current field from hook_field_widget_form()?

navij
  • 19
  • 1
  • 5

1 Answers1

0

You can use the module Devel to print the value of the $form array which will contain the form information you are looking for.

Example:

dpm($form);

You will be able to easily see the content of the form and access it with php in array form.

joshmmo
  • 1,062
  • 2
  • 13
  • 28