Fedora Insight: Creating a new View in Drupal for FWN issue

Pascal Calarco pcalarco at nd.edu
Thu Oct 14 20:12:23 UTC 2010


  Hi folks --

I am reporting out to the list what I've learned to date regarding 
creating a new View with Drupal for Fedora Weekly News all in one page.

Paul had created two fields using the Content Construction Kit (aka 
CCK)[1] module in Drupal for FWN issue and beat, and added these to the 
content creation form[2] .  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[3].  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[4], and I knew of this active group, 
Drupal4Lib[4], 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[6].

[1] http://drupal.org/project/cck
[2] http://publictest4.fedoraproject.org/drupal/node/add/fwnbeat
[3] http://publictest4.fedoraproject.org/drupal/node/2
[4] http://groups.drupal.org/libraries/resources
[5] http://drupalib.interoperating.info/node/88
[6] http://publictest4.fedoraproject.org/drupal/fwn/247

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!

I've also blogged about this at:

http://pascalcalarco.wordpress.com/2010/10/14/drupal-6-and-fedora-insight-working-with-views-and-cck/

   - pascal


More information about the logistics mailing list