Create a view of the first entityreferenced child item from a multifield for a list of parent nodes I have a node type A containing a multifield of entityreferences to another node type B and using only the views admin interface I want to create a list of the first type B child entityreference on every node of type A.
I think its possible just can't quite figure out how to do it.
Thanks
We usually name the referencing nodes Children, and referenced nodes Parents (Children reference Parents), so I'll assume it applies here that you want to show the first Parent in a multivalue ER field.
You need to create a list of type A nodes in a Block Display, add the ER field and select to show only the one, first value under Multivalue settings for the field.
This will give you a list of A-type nodes that shows only the first B reference.
Now we need to filter out only the A node that we're currently viewing. This can be done through the ID Contextual filter (under Advanced View settings), configure it:
When the filter value is NOT available
Provide default value
Content ID from URL
When the filter value IS in the URL or a default is provided
Specify validation criteria
Validator: Content
Content type A
Set the option for the case when the argument doesn't validate, and all the other options, to something that makes sense to you.
When you add the Contextual filter, depending on what option you chose for when the argument doesn't validate, you may see no results any more. To bypass the Contextual filter enter all into the Preview field (unless you change that default).
You can test the Contextual filter with Views Preview. Enter the node ID of the A node into the Preview field. You should see only the one result in Views, the result relating to the A node with the ID you entered.
If you're seeing expected results save the Views and place the Block into a theme region, but don't forget to set the Context option on Block configuration too.