Skip to content

Instantly share code, notes, and snippets.

@danielbehina
Last active August 29, 2015 14:14
Show Gist options
  • Select an option

  • Save danielbehina/c25d56052773d414e4d9 to your computer and use it in GitHub Desktop.

Select an option

Save danielbehina/c25d56052773d414e4d9 to your computer and use it in GitHub Desktop.
Get taxonomy ids from Entity refernce linked field.
<?php
$query = new EntityFieldQuery();
$query
->entityCondition('entity_type', 'node', '=')
->entityCondition('bundle', array('article'))
->propertyCondition('status', 1)
// používám entity_reference, tak získáme tid pomocí target_id
->fieldCondition('field_category_reference', 'target_id', $tid, '=')
->range(0, 10)
->propertyOrderBy('title', 'ASC');
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment