Magazines

Policy

IAC has decided to archive copies of Sport Aerobatics on the web site. Current members will have access to all stored issues, while non-members will only be able to access issues older than 12 months.

Implementation

There is a Drupal node type dedicated to magazines named, unsurprisingly, magazine. Each magazine node consists of:

  • Title: The full month and year of publication, e.g. January 2013.
  • PDF File: The magazine itself in Adobe PDF format.
  • thumbnail: An automatically generated image of the magazine cover.

Uploading

New issues are uploaded to the site using Drupal's standard "node add" functionality: www.iac.org/node/add/magazine

In order to maintain consistency and keep the PDF files in chronological order, please follow these instructions when adding a magazine issue:

  1. When creating PDF files, please name them SA-YYYY-MM.pdf, where YYYY is the year and MM is the month.
  2. In the Title area above, please enter the full month and year, separated by a space, such as: January 2012
  3. In the PDF File area above, click on Choose File, select the file you want, then click on Upload.
  4. Do not enter anything in the thumbnail area below. The system will generate the thumbnail image automatically.
  5. Near the bottom of the page, click on Authoring Information. In the Authored on box, enter YYYY-MM-01, where YYYY and MM are the year and month of publication. This is how the system sorts the magazines by publication date, so it is important to enter the correct value.
  6. Click the Save button at the bottom of the page.

Views

Thumbnail Images

The thumbnail is generated automatically by the PDF to Imagefield module. Configuring the module to work with magazine nodes was accomplished as follows:

  1. Navigate to Structure -> Content Types -> Magazine -> Manage Fields.
  2. Added a field called thumbnail, of type Image and using the Image widget.
  3. Modified the PDF File field to use the PDF to Image widget. Note: This step was counter-intuitive; I assumed that PDF to Image widget would apply to the Thumbnail, but in fact it must be applied to the file field that contains the original PDF.
  4. Under PDF Options, under the Target Image Field, select thumbnail.

Year Selector

The gray bar above the magazine images, containing the links All - 2013 - 2012 - 2011, etc., is a PHP block with the following code:

<div style="text-align: center;">
<a href="/magazines/all">All</a>
<?php
$i = date("Y");
for ($i = date("Y") - 1; $i >= 2001; $i--) {
  print("&nbsp;&ndash;&nbsp;<a href='/magazines/$i'>$i</a>");
}
?>
</div>

This code does the following:

  • Center-aligns the text
  • Outputs a link to www.iac.org/magazines/all
  • Gets the current four-digit year
  • For the current year and counting backwards until 2001 (the earliest year for which EAA can produce PDF copies of Sport Aerobatics), outputs a dash and a link to the magazines for that year, e.g. https://www.iac.org/magazines/2009

Inner Workings of the View

The magazine page is actually not a page at all in the classic HTML sense of the term; it's a Drupal view -- the output of a database query that is then formatted in accordance with a number of configuration parameters. (Click here for a list of tutorials about Views.) The magazine view can be examined and edited by clicking hereImportant: It's easy to screw up a view, and generally difficult to restore to the way it was before. So if you want or need to modify a view, I strongly recommend cloning the view first, making your changes to the cloned version, then replacing the old view with the clone once you're fully satisfied with your changes.

So, with that background and disclaimer out of the way, here's how the Magazine view works:

  • FORMAT
    • Format: Grid. This means the thumbnail images of magazine covers will be laid out in a grid.
    • Settings: To ensure compatibility with low-resolution displays, I selected a three-across layout.
  • SHOW
    • Fields: Selected fields from within the Magazine nodes will be displayed.
    • Settings: Uses the standard Views defaults.
  • FIELDS (Note: This is the first place that things get a little tricky)
    • (file from field_pdf_file) File: Name    -- This is the name of PDF file stored in the Drupal directories. If you click on this field name, you will see that the Exclude from display box is checked. This means that Views will retrieve the value, making it available for use a little later on, but will not display the actual file name.
    • Content: thumbnail   -- This is the thumbnail image of the magazine cover. It will be displayed as a JPG graphic that's also a hyperlink to the magazine's PDF file, i.e. clicking on the thumbnail will retrieve the compete magazine. To see how this works, click on this field name, then click on REWRITE RESULTS. You will see that the Output this field as a link box is checked, and under Link Path you will see the value files/magazines/[filename]. This tells Drupal to generate a link in form: https://www.iac.org/files/magazine/SA-2013-01.
    • Content: title   -- This is the magazine node's title, e.g. January 2013. The REWRITE RESULTS options are configured exactly the same way for this field, thus the user can get the PDF file by clicking on either the cover image thumbnail or the magazine's title.
    • (file from field_pdf_file) File: Size (Size) --- This is the size of the PDF file. These seem to range between 4MB and 7MB per issue; not trivial, but not huge by today's standards. Note: EAA's publication department can choose the output resolution: higher resolution = much bigger PDF files. The resolution we're currently using was chosen the lowest that still delivers resonable readability on a full-size computer display.
  • FILTER CRITERIA
    • Content: Published (Yes)   -- Only published magazine nodes are displayed. This setting is often used in Views to prevent the public from seeing content that the author/editor deems "not yet ready for prime time."
    • Content: Type (=Magazine)   -- The display consists of magazine nodes
  • SORT CRITERIA
    • Content: Post date (desc)   -- This tells Views to display the thumbnails in reverse chronological order, i.e. newest first, based on the magazine node's publication date. Important: This defaults to the current date when the user creates the node, which is almost certainly not the publication date of the magazine. That is the reason for step #5 in the Uploading section above. 
  • PAGE SETTINGS
    • Path: /magazines   -- This is non-host portion of the web address users follow to access the view, i.e. https://www.iac.org/magazines
    • Menu: Normal: Magazines   -- This means the view appears as a "normal" menu entry rather than, say, a menu tab. It is part of the Main Menu, and its entry in the menu will be labeled, again unsurprisingly, Magazines.  Note that the menu options for this page are principally managed by navigating to Structure -> Menus -> Main Menu -> List Links.
    • Access: Role | Multiple Roles   -- These settings control who is allowed to use this view. This view is configured for public access. Individual magazine nodes will have either public or member-only permissions associated with them, based on the policy discussed at the top of this page.
  • FOOTER
    • Global: Text area   -- This is a block of text about the magazine that appears below the grid of thumbnail images.
  • PAGER
    • Use pager: Display all items | All items   -- This setting tells Views not to use a "pager", those little web page widgets that show allow you to page through content.
    • More link: no   -- As with the pager, this option tells Views not to display a link labeled "more".
  • ADVANCED (yeah, this is the second place that things get a little tricky!)
    • CONTEXTUAL FILTERS
      • Content: Created year   -- This tells Views to display magazine nodes based on the year in which they were created, and on the value (if any) supplied at the end of the URL. So for example, https://www.iac.org/magazines/2009 will show only magazines from that year (once the EAA publications department uploads those issues.) If the year is omitted from the end of the URL, the current year is assumed. The use may also use the word all in place of the year, in which case all magazine nodes will be displayed.
    • RELATIONSHIPS
      • Content: PDF file:fid​   -- In all honesty, I can't fully explain what this setting does, beyond stating that it's necessary in order to make the Rewrite Link Output feature (discussed earlier) work properly.
    • NO RESULTS BEHAVIOR
      • ​Global: Text area (No Magazines for That Year)   -- This is the text that is displayed if there are no magazines for the selected year.
    • The remaining options in this section are unchanged from the Views defaults.

EAA Contact

Olivia Phillip of the Publications Department generates the PDF files and uploads them to the web site. She will also add back issues of the magazine to the site as time permits.