Organizing Your Website Content: Drupal Views
More and more schools are moving to content management systems (CMS) to more easily manage their websites. While many are going with propietary solutions like Schoolwires, my district decided to use Drupal. We have been using Drupal for our district's main site for about a year and a half now. Today I was asked by our communication's consultant if we could make changes to the "Stars in Our Schools" area on the district site. I asked her what she wanted to do. Well the impetus for the change came about because a parent noticed that our articles were a bit out of date. So she wanted to get some new articles up on the site, but didn't want to get rid of the older articles. There had been discussion about just unpublishing them, but it was felt that we needed an archive of some sort that would keep all articles for the foreseeable future.
Currently, this "Stars in Our Schools" area had been created as a view using the Views module in Drupal. So first let me tell you what the Views module does. This cool module basically allows you to run a search on the content in your database and find any kind of content based on any kind of parameter and then display it as a full page or as a block to be put on the side of a page. Given this very basic description of the views module, let me describe how the original view was configured. We wanted the block on the front page of our site (http://www.bainbridge.wednet.edu) to show a description of what "Stars in Our Schools" was and then pull two nodes (Drupal's term for a web page) at random from the nodes categorized as "Stars in Our Schools" and just list the titles with a link to the full article. With these parameters in mind, I created a view that searched the nodes in the database for records that had "Stars in Our Schools" as the content category and were currently published. I created a "block" view that only showed the titles of two randomly selected nodes and a "more" link that would go to a "page" view that showed the title of each article along with a short teaser with a link to the full article. These too were sorted randomly because you can only set a single sort criteria for the entire view, both page and block formats.
While good in theory, this method eventually became problematic as many of the older articles were selected randomly from the list and showed up on the front page of the website, completely out of context for the current date. Patrons started to notice that the articles were very out of date and complained about the site not being up to date. While talking to the consultant, the following parameters were identified for the new "Stars in Our Schools" section of the website:
- articles listed on the front page of the website had to be less than six months old
- articles titles still had to be randomly generated and limited to two on the front page
- articles listed when you clicked on the "more" link had to be less than six months old
- there needed to be an archive link somewhere on the front page that would take folks to the archive of all past successes
- the archive page would only list title and creation date of each node with the title being a link to the complete article
- the archive page would list articles chronologically in order from most current to least current
- there would only be twenty articles listed on a page
To accomplish this task I made some minor edits to the existing view and created a new view for the archived articles. In the footer of the original view I created a link to the archive view that always shows up on the front page of the site. When all was said and done this is what we ended up with... Click on a link to go to that page
- Front page of the district site
- What is seen when you click the "more" link
- What is seen when you click on the "archive" link
Just for fun I added an rss feed to the main more page and to the archive page. We are very pleased with the way it turned out. This is the true advantage of open source. If I was using a proprietary system, this would have been additional setup costs. Other views on the Bainbridge Island site are the main front page articles area, the school board agendas page, the board minutes page and a few things on the capital projects page. If you would like more details on the actual configuration please let me know.

Delicious
Digg
Facebook
Google
Yahoo
Technorati
Comments
Post new comment