creative insites header

Show fields from current node in Block View (Drupal 6)

February 20th, 2011 Tutorial

This tutorial assumes a working knowledge of drupal, views, and cck.

I have been working on a project management system for us and our clients. I created a progress bar that visually shows how close a project is to completion. I wanted to show this progress bar in a block on the project page. In order to do this, I needed to create a block view. I wanted to share how easy this is because I really didn't find too much about it.

First, create a new view and call it anything. I used an existing view I had and added a new display block title, 'Progress bar Block'.

Next, add whatever fields from the node you would like to display. In my case, I added the cck percentage field I was using for the completion field. Once the field is setup, an argument needs to be created (the argument is sort of like a filter but you are using the URL to filter the content).

The settings I used for the argument are as follows:

  • Node: Nid
  • Provide default argument
  • Node ID from URL
  • I left everything else default

Once the view is setup, the block will need to be place into any region in your theme. In my opinion, this is a VERY easy and cool trick to add some variety to your pages.