1

When I manage fields in content type edition I can put them in order. How could I retrieve this information to use it in a custom module. In Database there is no any column which saves weight order information of fields as they appears in "Manage fields" tab in content type edition.

1 Answer 1

1

Use field_info_instance()

  $entity_type = 'node';
  $field_name = 'body';
  $bundle_name = 'article';
  $body = field_info_instance($entity_type, $field_name, $bundle_name);

Which gives you access to numerous config/settings

enter image description here

  $body_weight = $body['display']['default']['weight'];

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.