I have been using the following line to get all the nodes with a term id
But now I want to sort the output by weight (field_audio_weight - field I created).
How can I achieve the same output using
Drupal Answers is a question and answer site for Drupal developers and administrators. It only takes a minute to sign up.Sign up to join this community
$query = new EntityFieldQuery() ->entityCondition('entity_type', 'node') ->fieldCondition('field_taxonomy_reference', 'tid', TERM_ID) ->fieldOrderBy('field_audio_weight', 'value', 'DESC'); $results = $query->execute();
Check these articles for more information: