Views from World Shakespeare Bibliography submission site

Before their migration to a new Drupal-based website, I worked with the World Shakespeare Bibliography to develop an interim submissions site that allowed their contributors to submit references to new Shakespeare-related publications or performances. Drupal’s content creation forms provided more user-friendly interface for the contributors to enter all the necessary information, and Views was used to display the submissions using the obscure, pre-digital formatting conventions that were required for final submission to the publisher.

The data model

We started by taking a look at numerous examples of existing submissions. One of the most difficult parts of the project was figuring out how many content types there needed to be. Was every submission type its own content type? Or was there significant overlap between some of the types? Ultimately, we decided to split it into two primary content types: “submission” and “review” (the latter for reviews of plays and the like). There were also a number of important vocabularies for the site: Authorial roles, Languages, Plays, Submission type, Theatrical roles.

The first field in the Submission content type was a term reference field that listed the various types of documents (e.g. “Article in a book collection”, “Book collection”, “Book monograph”, “Computer file / internet site / CD-ROM”, etc.”) This served as a conditional field, triggering the appearance of those fields that didn’t apply to all the document types. For instance, an “Authorial roles” field only applied to articles in a book collection, book collections, book monographs, and computer files.

Submission content type on World Shakespeare BibliographyField Settings for Submission content type

Conditional field settings for Submission content type on World Shakespeare Bibliography

Conditional field settings for Submission content type

Adding fields to a vocabulary

This site was one of the rare cases where it made sense to add fields to a vocabulary. There was a “languages” field in the submission content type, and we decided it would be easier for submitters to select a language by its full name, rather than requiring them to know the correct two-letter ISO abbreviation for the language. All of the term names in the Languages vocabulary are the full name of the language, and we added a “language code” field to the Languages vocabulary and populated it with the abbreviations we’d need on the export. We did something similar for the Plays vocabulary, putting in a field for “play code”, a numeric identifier for each of Shakespeare’s plays. The same applies to the Submission Type vocabulary, with the “abbreviation” field (e.g. “article in a book collection” is “ar”; “computer file” is “co”).

Play code field in Plays vocabulary on World Shakespeare Bibliography


The view

Most submission types showed some slight variation in how they should be formatted for the publisher. Setting up a view to display any one of those submission types with the correct formatting would be reasonably straightforward, but we needed a single view that could output all the different submission types, correctly with their unique variation. This called for a lot of rewriting, as well as the Views Conditional module (which lets you display different things for the field output depending on the value of the field). In a few cases, a field (such as Year) was added multiple times, because it needed to be processed in different ways before outputting.

You may notice in a lot of the rewriting described below that punctuation is being added directly to values that are being excluded from display, rather than in the rewritten form that actually gets displayed. This is a good approach when you’re not sure that a field is going to have a value. If a field doesn’t have a value, but you’ve included the punctuation associated with it (e.g. parentheses, commas, periods, etc.) as part of the final rewriting, that punctuation will still be there even if the value is not. This leads to some very odd-looking displays, for instance:

Bottrall, Margaret. "A kind of picture left behind me," Every Man a Phoenix. : John Murray, 1958. (pp. ).

In this case, the city of publication and the pagination were not filled in, but you’ve still got the colon for the city and the parentheses and “pp.” for the pages in the citation. If you rewrote the value of the (hypothetical) “publisher city” and “pagination” fields, respectively, to contain the appropriate punctuation, you’d have a much cleaner looking display even when not all the data is present:

Bottrall, Margaret. "A kind of picture left behind me," Every Man a Phoenix. John Murray, 1958.

Here are the fields used in the view, with notes on each:

  • (term from field_plays) Taxonomy term: Play code
    • Uses the relationship Content: Plays to pull in the “play code” field from the Plays vocabulary
    • Rewritten to put a % before the value
  • Content: Title
    • Not meant to be exported, but provides an easy link to the submission to make it editable
  • (author) User: Name
    • Uses the relationship Content: Author to pull in the “name” field from the user account of the person who submitted it
  • Content: Post date
    • The date the submission was added to the system. This and the “User: Name” field are displayed inline (i.e. by checking the boxes next to those fields in the “Settings” area of the “Format” section of the Views UI)
  • Content: Author or Editor
    • Rewritten to put a %.10 before the value
  • Content: Authorial roles
    • Rewritten to put a %.11 before the value
  • Content: Theatrical or film production role
    • Rewritten to put a %.12 before the value
  • Content: Dissertation/article title
    • Rewritten to put a %.25 before the value, surround the value with quotation marks, and put a period at the end
  • Content: Work title
    • Rewritten to put a %.20 before the value and a period at the end
  • Content: Additional information / roles
    • Rewritten to put a %.27 before the value and a period at the end
  • Content: Edition
    • Rewritten to put a %.27 before the value and a period at the end
  • Content: Series statement
    • Rewritten to put a %.28 before the value, surround the value with parentheses, and put a period at the end
  • Content: Book collection editor
    • Excluded from display, to reuse for rewriting below
  • Content: Date of film/audio recording
    • Excluded from display, rewritten to put a period at the end
  • Content: Volume number
    • Excluded from display, rewritten to put a space before the value
  • Content: Issue number
    • Excluded from display, rewritten as follows: , no. [field_issue_number]
  • Content: Pagination (articles)
    • Excluded from display, rewritten to put a colon and space before the value
  • Content: Pagination (monographs and book collections)
    • Excluded from display, rewritten to put pp. after the value
  • Content: Place of publication
    • Excluded from display
  • Content: Year
    • Excluded from display, rewritten to put the value in parentheses with a space in front of it
  • Content: Year
    • Excluded from display, rewritten to put a comma and space in front of it
  • Content: Year
    • Excluded from display, rewritten to put a period after it
  • Content: Year
    • Excluded from display, rewritten to put the value in parentheses with a colon after it
  • Content: Length of film/audio recording
    • Excluded from display, rewritten to put a period after it
  • Content: Film/audio recording production company
    • This is a field that is unique to one of the formatting variants, so if we know that a submission has a value in this field, we know how it should be formatted. The value is rewritten using tokens from excluded fields above (names are pretty transparent). The field is rewritten as %.30 [field_film_audio_recording_produ], [field_date_of_film_audio_recordi]. [field_length_of_film_audio_recor]
  • Content: Production dates
    • Excluded from display, rewritten with a comma and space before the value
  • Content: Production Venue, City, State
    • Excluded from display, rewritten with a space and at before the value
  • Content: Theatrical production company
    • This field is unique to a formatting variant, and is rewritten using tokens: %.30 Produced by [field_theatrical_production_comp] [field_production_venue_city_stat][field_production_dates]. [field_length_of_film_audio_recor].
  • Content: Bibliographical database containing the dissertation abstract
    • Excluded from display
  • Content: Name of degree-granting university
    • This field is unique to a formatting variant, and is rewritten using tokens: %.30 [field_bibliographical_database] [field_year_4] not paginated ([field_degree_granting_university]).
  • Content: URL
    • Excluded from display, rewritten with a space before the value
  • Content: Journal title
    • This field is unique to a formatting variant, and is rewritten using tokens: %.30 {i[field_journal_title]}[field_volume_number][field_issue_number][field_year][field_pagination][field_url_1].
  • Content: Publisher
    • This field is unique to a formatting variant, and is rewritten using tokens: %.30 [field_place_of_publication]: [field_publisher][field_year_1]. [field_pagination_monographs_] [field_url_1]
  • Content: Book collection title
    • This field is unique to a formatting variant, and is rewritten using tokens: %.30 [field_book_collection_editor], [field_book_collection_title][field_pagination].
  • Content: This is a URL associated with a journal or article
    • Excluded from display; used for Views Conditional, below
  • Content: This is a URL associated with a website with no publisher information (This is a URL associated with a website with no publisher information)
    • Excluded from display; used for Views Conditional, below
  • Views: Views Conditional (If field_journal_url is NOT empty 0, output [field_url_1], else output )
    • If the field (a boolean / single-checkbox field) in the submission that specifies that the URL is associated with a journal or article is checked, display the URL; otherwise, display nothing
  • Views: Views Conditional (If field_website_no_publisher is Equal to 1, output %.30 [field_url_1]., else output )
    • If the field (a boolean / single-checkbox field) in the submission that specifies that the URL is associated with a website that has no publisher information, display  %.30 [field_url_1]. Otherwise, display nothing
  • Global: Custom text
    • Displays %.34 on its own line (this field is always empty)
  • Content: Year (%.35)
    • Uses %.35 as the label for the field. Under “Style settings”, “Customize field HTML” is checked, and the HTML element specified is SPAN. This ensures that the label and the field value appear on the same line.
  • Content: Annotation (%.40)
    • Configured like Content: Year (%.35), using %.40 for the label
  • Content: Number of essays on Shakespeare
    • Rewritten as %.40 [Includes [field_number_of_essays_on_shakes] essays on Shakespeare.]
  • Content: Reviews (%.50)
    • Configured like Content: Year (%.35), using %.50 for the label
  • Content: People (%.61)
    • Configured like Content: Year (%.35), using %.61 for the label
  • (term from field_document_type) Taxonomy term: Abbreviation
    • Pulls in the “abbreviation” field from the “Submission Type” vocabulary using the Content: Document type relationship. Rewritten to put a %.76 before the value
  • (term from field_languages) Taxonomy term: Language code
    • Pulls in the “language code” field from the “Language” vocabulary using the Content: Language relationship. Rewritten to put a %.79 before the value
  • Global: Custom text
    • Displays %.80 on its own line
  • Global: Custom text
    • Displays %end on its own line
  • Content: Plays (Plays)
    • Not meant to be exported; human-readable list of the plays that are part of the submission
  • Content: Keywords (Keywords)
    • Not meant to be exported; human-readable list of keywords associated with the term
  • Content: Notes (Notes)
    • Not meant to be exported; human-readable notes associated with the submission
  • Global: Custom text
    • Two HTML line break tags (<br /><br />) to provide adequate spacing between entries as part of the export display

A few exposed filters makes it easy for the editors to just look at the most recent submissions. There are also two variants of the view: one for the editors to look at (which includes things like notes and keywords), and one for use with the export (which just contains the text to be submitted to the publisher).

World Shakespeare Bibliography view for submissions

An example submission as displayed by the view.