2

devel dsm

Trying to retrieve tid from field_report_group in my module. I can not seem to be able to grab it. Any help would be appreciated.

3 Answers 3

2

Assuming you have a variable containing the entire structure that you have added.

Try

$taxonomy['8942']->field_report_group['und'][0]['tid']
0
0

Depending on the context you are loading the term (template or module) there may be more appropriate ways but a general one is to use:

taxonomy_get_term_by_name if you don't have the tid

taxonomy_term_load if you do have the tid

and taxonomy_get_tree if you want to load the whole vocabulary

2
  • I am attempting to accomplish it in a module. Jun 4, 2015 at 1:31
  • depending on what you have available to you, use the appropriate function (they are linked to their documentation page) dpm the new structure and go from there Jun 4, 2015 at 1:46
0

You should use field_get_items($entity_type, $entity, $field_name);

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.