Website

Like all websites, this site requires ongoing maintenance and support. This collection of pages provides details of the techniques used to implement and maintain the site. This site is uses the following tools:

These links provide additional tips some of which have been used on this site.

Drupal tips and techniques

In order to improve the capabilities of the website, Drupal has been customised using a combination of modules and custom changes. We are using a number of contributed modules:

Each customisation will be detailed in its own page within this book.

Bibliography filtered by date range

Background

The website uses the Bibliography module to capture links to documents related to Software Engineering and Project Management topics, as well as the SimpleNews module to produce an online newsletter. We wanted to be able to list the bibliography entries in the newsletter to keep people informed. A customised view seemed like the perfect implementation.

The requirements for the view were:

  1. List all bibliography entries created between a specified start date and end date;
  2. The start and end dates are not to be hard coded into the view definition;
  3. The page using the view will define the start and end dates;

Implementation

Requirement 3 was relatively easy to implement. Each page using the view will use the Insert View module to insert the view into the page. The syntax for doing this is:

[​view:DateRangeBiblio=1000=2007-03-01,2007-03-31]

This limits the view to 1000 entries created between 1-Mar-07 and 31-Mar-07.

[​view:DateRangeBiblio==2007-03-01,2007-03-31]

This retrieve all entries created between 1-Mar-07 and 31-Mar-07.

Requirements 1 and 2 were a little harder to implement, but we got there eventually. The tricky bit was figuring out how to get the start and end dates into the view arguments, and then get them recognised. This was done using the view argument handling code shown below:

<?php$start_date = $args[0];$end_date = $args[1];$view->filter = array(    array(        'tablename' => 'node',        'field' => 'node.created',        'operator' => '>=',        'value' => $start_date),    array(        'tablename' => 'node',        'field' => 'node.created',        'operator' => '<=',        'value' => $end_date),);$view->query = '';$view->is_cacheable = 0;?>

List of book reviews filtered by date range

Background

The website uses the Book Review module so that authors can review books. We wanted to be able to list new book reviews in the newsletter to keep people informed. A customised view seemed like the perfect implementation.

The requirements for the view were:

  1. List all book reviews created between a specified start date and end date;
  2. The start and end dates are not to be hard-coded into the view definition;
  3. The page using the view will define the start and end dates;

Implementation

Requirement 3 was relatively easy to implement. Each page using the view will use the Insert View module to insert the view into the page. The syntax for doing this is:

[​view:DateRangeBookReview=1000=2007-03-01,2007-03-31]

This limits the view to 1000 book reviews created between 1-Mar-07 and 31-Mar-07.

[​view:DateRangeBookReview==2007-03-01,2007-03-31]

This retrieve all book reviews created between 1-Mar-07 and 31-Mar-07.

Requirements 1 and 2 were a little harder to implement, but we got there eventually. The tricky bit was figuring out how to get the start and end dates into the view arguments, and then get them recognised. This was done using the view argument handling code shown below:

<?php$start_date = $args[0];$end_date = $args[1];$view->filter = array(    array(        'tablename' => 'node',        'field' => 'node.created',        'operator' => '>=',        'value' => $start_date),    array(        'tablename' => 'node',        'field' => 'node.created',        'operator' => '<=',        'value' => $end_date),    array (      'tablename' => 'node',      'field' => 'node.type',      'operator' => 'OR',      'options' => '',      'value' => array (  0 => 'bookreview'),),);$view->query = '';$view->is_cacheable = 0;?>