Managing file content

Unlike most of the other content types, items of the filepublic and fileprivate content types are not generally linked to from our menu system or displayed in collated Drupal views. These file types act as a kind of wrapper around a resource such as a PDF that you might want to link to from another type of website content, e.g. a basic page or article.

For example if you have written a piece on a new survey using the article content type for display on the homepage, you might want to add a PDF resource, e.g. survey instructions. To do that create a new item using the file content type (as described below), and either make a note of it's URL or give it a memorable URL alias (as described in the general instructions). Then from your article, use the link button from the toolbar of the body field editor, to add a link to the file item  you created.

The difference between filepublic and fileprivate, as you can guess, is that the former can be viewed by any visitors to our website, but the latter can only be viewed by logged in members. Creating an item for either of these types is identical.

There are three fields:

  • Title
  • Body
  • Public file or private file

Use the title field to give a descriptive name to the file. This will not normally be the name of the file itself, but normally something more desriptive. You can use the body field to provide a description of the file resource(s) you attach to the item, but this is optional and often it is more convenient to leave this blank.

Use the browse button to locate the PDF that you want to upload and associate with this file item. You can actually add as many as many separate PDF files as you like to a single file item. This can be useful when it makes sense to associate PDF resources together (as in the second example shown below).

Image
Example file resource
Image
Example file resource

The first of these examples is a public file resource - which is why it has the social media share buttons on it. The private file resources cannot be shared to social media. The second example - a private file resource - actually has three related PDFs associated with it. (The user can download these separately of course.)