Sort view items by field collection's field value I added a field collection to Basic page that contains:


box title
box image
box position on page


You can add 0 or more field collection's items to every basic page. Every node may contain 0 or more boxes. They will be used instead of default teasers. Here is an example:

Node 1:


field collection item: [Title 1, image1.png, 3]
field collection item: [Title 2, image2.png, 1]


Node 2:


field collection item: [Title 3, image3.png, 2]


Taxonomy Term View is configured as below:

Format: unformatted list
Show: Fields

FIELDS

Field: The field collection

FILTER CRITERIA

Content: Published or admin

SORT CRITERIA

Field: box position on page (asc)
Content: Post date (desc)

CONTEXTUAL FILTERS

Content: Has taxonomy term ID (with depth)
Content: Has taxonomy term ID depth modifier

However, items are sorted only by post date and "box position on page" field has no impact on sorting. I expect boxes to be sorted in this order:


field collection item: [Title 2, image2.png, 1]
field collection item: [Title 3, image3.png, 2]
field collection item: [Title 1, image1.png, 3]


Note that 2nd box leads to Node 2 and the remaining to Node 1.

How to sort boxes by "box position on page" field that is part of field collection?
You can use field_collection_views module which it creates a default View of field collection type. Its address is /admin/structure/views/view/field_collection_view and I recommend you clone this View and configure the rest of the options. The Fields section contains a few items that are very helpful, like Host Entity ID, Host Entity Type and ... .