Pascal’s place


Views on technology and libraries

Drupal 6 and Fedora Insight: Working with Views and CCK

I’ve been helping out with a new site for Fedora Project (linux distribution) information that we’re calling Fedora Insight, and here’s my recent worklog on this, specifically finding out how CCK and Views work.

Paul had created two fields using the Content Construction Kit (aka CCK) module in Drupal for FWN issue and beat, and added these to the content creation form . The default view for this was to associate each beat’s Drupal node to a Book that constituted an FWN issue See FWN 239 as an early example. What we needed to do next was create a new View that would display all of the nodes from a particular issue in a single page. Being someone who works in libraries, there are a lot of sites that use Drupal, and I knew of this active group, Drupal4Lib, a discussion list for libraries that use Drupal, so I joined and asked around. Several posters pointed me to “passing an argument via node id” to the view. That was a start, and I poked around a bit and created a new View, with the content_issue field that Paul created in the CCK passed to the view, and I set the path for the new View to use /fwn. Finally, I entered some sort criteria to display the issues in descending order, and applied a filter for the node type = weekly news beat. Now I can reference all of the beats associated with an issue easily — ie. /fwn/247. I’ve marked up the latest FWN in just such a way.

What remained was to display the title of each beat, since this was passed in the CCK as a hidden variable. So I edited the “Weekly news beat” content type, managing the fields, and turned the Beat Label from “Hidden” to “Above” in the “Display fields” tab. For some reason this didn’t work at first, so I figured I still have to mess around with the View to make it visible. I can’t actually see the title of each beat yet, so will still keep on working with this, but have made definite progress!

Filed under: fedora