In my Drupal 7 website I have an A content type with an entity reference 'parent' field which I use to link to nodes of a B content type.

I have to implement a way to sort A nodes basing on their B parent.

Modules such as Nodeorder and Nodequeue (smartnodequeue) can achieve this with term references. Is there any way to sort them based on entity references without creating vocabularies and term reference fields? I would prefer a draggable solution.

  • This would seem to be a good use case for EVA (Entity Views Reference) + Draggable views, but last time I checked, I couldn't get them to work together. I added an issue for this here: drupal.org/node/2005690
    – Dave Bruns
    Nov 4 '13 at 19:40

Create a view that shows Content of type "A", add a relationship for Entity Reference: "B". Then add a sort criteria and sort by Content "A". Choose the relationship on the sort criteria as the relationship you made earlier. You can expose the sort order so it can be chosen to sort ascending or descending. This is not a draggable solution but it does allow you to sort by the referenced entity.

  • Can you expand on what to select in the 'sort' dialog? Presumably you mean to select a given field of entities to type B, such a 'B: title'. Sorting by this doesn't appear to work.
    – tog22
    May 10 '14 at 6:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.