Drupal 5: Creating a Block View that shows Related Content using Taxonomy and Arguments
Here is how you can create a block view that shows related content items based on taxonomy. First, setup taxonomy for your node types. In my example, I created a category named ‘Topics’ and added a bunch of terms to it. Next, I edit/added my nodes and assigned taxonomy to them of this category.
Second, create a block view. Make sure you enter all the necessary information (filters, fields, sort criteria, etc). The piece that makes this view work is the argument. Add an argument of type “Taxonomy: Term ID”. Change the option to “use empty text”. I then assigned this block to a region and set it to only show up on certain node pages.
The next part involves adding some code. In my example, I needed to modify the html/css/layout of the block, so I decided to add a file to my theme called “block-views-MYVIEWNAME.tpl.php”. This could have been accomplished using argument handling code (in the view settings), but I prefer to keep my code out of my database when possible, to version my code using subversion. Here’s the contents of the block-views-MYVIEWNAME.tpl.php file: