Here is a use case that happens to me all the time, and I am boggled that I haven’t found a simpler solution. I have a bunch of Faculty nodes, and I want to specify that some of them belong to various Committees. I want a committees page that has a linked listing of committees, and then each committees page should have a description of the committee and a linked list of all the members. Also it needs to be dead simple for a non-skilled content editor to edit the committee descriptions and to create new faculty without needing to create all the committees ahead of time.
You can do almost all of this with Taxonomy free tagging and Views 2, but the easily editable per-committee description trips you up. For that you need a node type with a Reverse Node Reference. I am open to suggestions, but here is how I do it:
- Views 2
- CCK’s Node Reference
- Popups: Add and Reference
- Create a Committee node type.
- Add a Node Reference to the Faculty node type called ‘committee’.
- Use Views 2 to create a reverse-reference view (These instructions are based on Create a view on a node reference field)
- Add a view with view type ‘node.
- In Relationships section select the committee node reference field and enable ‘Require this relationship’.
- In Arguments section select ‘Node:nid’ – this will be used to enter the Artist’s node id.
- In Arguments Configuration, select the Relationship ‘Committee’.
- Use the appropriate Sort criteria. I used ‘Last Name’.
- Then create a node-committee.tpl.php in your theme, and add:
$view = views_get_view('committee_members');
print $view->preview('default', array($node->nid));
This accomplishes all my goals. The editor can create a new committee either from the “Create Content” page, or while creating a new faculty member, and the committee description is easily edited. I am a little unhappy having to resort to the theme layer. Maybe I won’t need to once the viewfield module releases a stable Drupal 6 version.