Drupal 7 tip : Get field values from entity objects like nodes, users, taxonomy, ...
Related content
- Drupal 7 tip: Add contextual links to anything
- Drupal7 tip: Alter a field widget
- Drupal 7 tip : Theming : Render only a single field of your entities
- Drupal 7 tip : Update and insert only specific fields of your entity
- Drupal 7 tip: Use menu local tasks for on page tasks
- Drupal 7 tip: Query your entities for field values
- Just load one field of your entity
- Drupal 7 tip: Don't use theme('...', ...) use render arrays
- Saving node's fields without saving the node itself
- Node add only fields


Handy
I think it is usefull to omit the language so it is calculated automatically. So even more convenient is :
<?php
$items = field_get_items('node', $node, 'field_yourfield');
?>
Your right, if the current
Your right, if the current language is needed you can ommit the language parameter.
Super helpful! Thank you.
Super helpful! Thank you.
Good tip
Good tip, will have to keep that in mind.
If you are using Entity API module, you could also use entity_metadata_wrapper() to achieve this...
A question regarding the function found at drupal7ish
I have a question regarding the function found at:
http://drupal7ish.blogspot.com
It returns taxonomy term names, what change do I need to make for that function so it would return tid's instead ?!
Thanks.
field_extract module
Thanks for noticing my little function - but there is now a module, field_extract, which provides a couple of versatile functions for fetching data in various ways from entities, you can find it here.