Posted by sifuhall on January 28, 2010 at 4:02am
I have 2 types of content, lodges and members.
Every member can only belong to 1 lodge, and every lodge will have many members.
I have created the members content type and it includes a node reference field that allows the selection 1 of the available lodges (I love that I could create a view to allow users to build the list of lodges).
And now on the lodge pages, I would like to display the members that have selected this lodge in their page.
How can I do this?
Many thanks for the help!
Comments
I did this with a views reference
1) Create a view of your members with an argument set to the lodge node reference field, set the default argument to node id from URL.
2) Install http://drupal.org/project/viewreference
3) Add a view reference field to your lodge type and set it to the view from #1, This way when its displayed on a lodge page it takes the nid of the lodge and displays all the members that match.
Possible problems:
-I needed to manually update all my content with the new view field before it displayed (easy enough with some SQL)
-May not work/need more work if you use custom paths that do not include the nid (I have not tested this yet)
I believe the simplest
I believe the simplest approach is to use the Views Attach module. The Node Content display type will allow you to designate a view to be attached to all nodes of the "Lodge" type and to pass through the nid of that node to your arguments. Then, set your View argument to the CCK Nodereference field you are using to specify the Lodge.
Another option is to use the
Another option is to use the Panels module.
1) do RalphSleigh's #1.
2) Enable the node/%node page in the Panels module.
3) add the view to a pane of the panel, and pass the node id to the view as the argument.
Panels seems like a very
Panels seems like a very heavy module to use if this is the only featured needed from it.