I have two content types:
- Business listing
- Product listing.
"Product listing" has an Entity Reference field. This field points to the nodes of "business listing". I want to allow user to choose from his own "business listing" nodes (during adding a "product listing" node). I have created a view to list the nodes of "business listing" type and have added an Entity Reference display to the view. Then I selected the view Under "Entity selection". Now, I have a problem in adding proper contextual filter. I have added a contextual filter of "Content: Author Uid" and selected "provide default value".
a) if I select "USER ID from logged in user" as default value:
This solution will break if an admin is editing the node. The field will then show only nodes the current user (admin) has created.
b) if I select {"User ID from URL" and "Also look for a node and use the node author"}: This solution will break if an user is adding a new node. The field will not show any nodes! http://example.com/node/add
please guide me