2

Thanks in advance for any help or suggestions with this problem. I will try to be as clear as possible. Basically, what I want to do is customize my Page node "County" to show a table of "Organization" nodes (along with their contact information) referenced in the county node.

So what I have done is to use the EVA + Corresponding Node References modules to create a table view on my county page. The problem is that I cannot figure out how to configure Views so it will list the organizations in the same order that I referenced them in the county node -- See screenshot http://www.diigo.com/item/image/16wo5/0jmw. As you can see from my screenshot I have ordered them first "Org 3" and then "Org 1", but in the views table they are ordered first "Org 1" and then "Org 3".

From reading other posts I suspect that I need to add a relationship in my view but I feel like I have tried almost everything and I still can't get it to sort correctly. Here's a screenshot of my Views admin page -- http://www.diigo.com/item/image/16wo5/x7hr

Thanks again for any help.

-Scott

2 Answers 2

1

Ok, I think I figured this out after some ideas I got while researching kalabro's answer. Basically I needed a better understanding of the logic of how EVA works with node references and related objects in views. So here's what I did --

First I changed the contextual filter in my view to "Content: Nid" with a default value of "Content ID from URL". Next I added a relationship to the field "Related Org" (which is the node reference field in my County content type) and did not check "require this relationship. Then I filtered my results to only include County content types and added the "Related Org" relationship to the title and body of my included fields -- except for the first title field (the related county itself) which I used to group the related organization by. Finally, I removed all sort criteria from the table settings and from the sort section.

Here's a screen shot of my views set-up: http://www.diigo.com/item/image/16wo5/7chr

Here's a screen shot of my county view: http://www.diigo.com/item/image/16wo5/r1dx

After thinking about this problem some more I'm not sure that I actually needed to create the corresponding node reference in order to accomplish this. I haven't tested it yet. Also, there may still be some tweaks to this set-up that don't show up because of my limited testing. Still, I feel like I'm on the right path now with a better understanding of how EVA, node references, contexts and relationships work together in views. And I am definitely left with a greater appreciation of the power of Drupal 7.

If anyone wants more details about my set-up please let me know.

Thanks to kalabro for helping me to get started thinking in a different direction.

-Scott

0

You shouldn't use 2 references at the same time. If you prefer your «Related Org» field, you don't need EVA at all. Just customize display settings for your «Related Org» field. enter image description here

Help link: http://drupaleasy.com/blogs/ryanprice/2009/08/theming-nodereference-or-reusing-complex-data-drupal

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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