A common use case is to include the contents of a particular view in all nodes of a particular content type. The following example shows how to do that.

In this example we work with a view that takes a single nid argument to display a list of references for an article.

  1. Download, install and enable the Views, References (Drupal 7) or CCK Node Reference (Drupal 6), and Viewfield modules.
  2. Create a content type Article (D6).
  3. Create a content type Article Reference that contains a node_reference field. Restrict the field to only allow references to Article nodes. Make some test Article Reference nodes, linking them to articles by supplying appropriate node_reference values.
  4. Create a view named 'article_references' that displays Article Reference nodes. Add a content argument / contextual filter that refers to the node_reference field, and make views validate it as an Article nid. Test the view with an Article nid to make sure it correctly displays references for the article.
  5. Add a field of type Views to the Article content type.
    • Specify 'article_references' as an allowed view.
    • Supply a default value of 'article_references'. In the arguments textfield enter [node:nid] (Drupal 7) or %nid (Drupal 6).
    • Click 'Always use default value'. This will automatically assign the default value when each node is saved, and will hide the viewfield on the node edit form so it doesn't distract authors.
  6. View an article. You should see a list of the references for that article in the node content.