Last active
August 29, 2015 14:14
-
-
Save danielbehina/c25d56052773d414e4d9 to your computer and use it in GitHub Desktop.
Get taxonomy ids from Entity refernce linked field.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?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