Any plans to upgrade this? Anyone run it through the Coder module?

Comments

Brian MacKinney’s picture

The front page says that this is a feature of the references module in drupal 7, but that module has 0 documentation. It should be simple in views, though, but the arguments system (views) was replaced by context and relationships, of which there is no documentation for this use. I'm trying to figure it out now and will post a tutorial somewhere when I do.

mgifford’s picture

Thanks! Submitting an issue about the need for documentation sometimes helps.... Though usually not enough.

Brian MacKinney’s picture

Status: Active » Closed (works as designed)

With References installed, add a node_reference field to a content type, and enable it to refer to another content type.
Pathauto is also recommended.
Create a new view (block display) with a filter criteria (left column) of the referring content type, and a contextual filter (advanced, right column) of the node_reference field. Using panels or the blocks system, add the view block to pages of that content type.

For example, one of my sites features a 5-part film, with a content type of "video". We also have a content type "lesson plan" that has a node reference field which is restricted to referencing videos. As lessons are added, users can reference the video segment they are associated with. The view is titled "LP References" and has a format of "unformatted list", showing "fields". The field it displays is Content:Title (linked to the node). Filter criteria are Content: Published and Content: Type = Lesson Plan. In the advanced section of the config menu for the view, I added a contextual filter "Content: Video (field_lp_video_reference)".

In the settings for that contextual filter (arguments in D6) you must select "Provide Default Value - Type: Raw Value from URL" with "Path component: 2" (The numbering starts from 1, e.g. on the page admin/structure/types, the 3rd path component is "types".) What this does is it looks at that part of the current node's path, then compares it to the values of the lp_reference field for the Lesson Plans content type, and if there is a match it displays the specified content for those nodes that match. No other checkboxes should be checked.

Apply and save the view. I use panels node templates, so on the node template for the video content type, I add the newly created view, and now all of my video pages display a list of links back to the lesson plan nodes that reference the current node.

I hope that helps. I will be adding a tutorial with images to my site once it is up. If you have any questions don't hesitate.