Media Type File - NCIOCPL/cgov-digital-platform GitHub Wiki

Things Lindsay Isn't 100% Sure About:

  • Our current nciFile has dates + date display mode, but the date doesn't display on the front-end... doesn't it make sense to remove Date Display Mode? Date display mode would be used if the file is placed in a list which has a template that displays the date. We should keep this.
  • See File Size further down the page – how does this work? It currently doesn't display on the form field. Displays when files are added to Related Resources or lists.

Fields to Deprecate?

  • File Extension (item_file_attachment_ext) - automatically is added to the form after user uploads file. Is this necessary?

Naming

  • Display Name: File
  • Machine-readable Name: cgov_file

Description

Used to upload all downloadable file types, such as PDFs, Excel spreadsheets, and Word docs.

All file types are permitted to be uploaded.

The maximum file size is 250MB.

Fields

Common Fields

Local Fields

File Attachment/Upload

  • Field Name: field_file_attachment
  • Label: File
  • Type: file upload
  • Required: Yes
  • Max Characters: N/A
  • Tooltip Text: Browse to the file on your computer that you want to upload into Drupal.
  • Translatable: Yes

Uploaded Filename

Once a user uploads/saves a file into the system, this field should populate with the filename of the attached file. This field should not be editable.

  • Field Name: field_file_attachment_filename
  • Label: Uploaded Filename
  • Type: text (plain)
  • Required:
  • Max Characters: N/A
  • Translatable: Yes

File Type

Once a user uploads/saves a file into the system, this field should populate with the type of file that was uploaded to the field_file_attachment. This field should not be editable.

  • Field Name: field_file_attachment_type
  • Label: File Type
  • Type: text (plain)
  • Required:
  • Tooltip Text: Automatically appears once you upload the file.
  • Max Characters: N/A
  • Translatable: Yes

File Size

  • Field Name: field_file_attachment_size
  • Label: File Size
  • Type:
  • Required:
  • Tooltip Text:
  • Max Characters: N/A
  • Translatable:

Display Rules

  • For each file added to a list, the following should be displayed"
    • an icon based on the file type. Files that will have icons are:
      • pdf
      • MS Word (.doc and .docx)
      • MS Excel (.xls and .xlsx)
      • MS Powerpoint (.ppt and .pptx)
      • mobi
      • epub
      • exe
      • txt
    • the file size
      • Display the file size for all file content types, rounded to the nearest integer.
  • if no icon is available, then show the file type extension
    • Example of what should display: File Title (.filetype) (5.3 MB)
  • If file type is HTML:
    • Do not show file file type extension
    • Do not display the file size

Example URLs

Form Display Order

  • Language Dropdown
  • Site Sections
  • Pretty URL
  • Name
  • Short Title
  • Card Title
  • List Description
  • Feature Card Description
  • Promotional Image
  • Posted Date
  • Updated Date
  • Reviewed Date
  • Date Display Mode
  • Search Engine Restrictions
⚠️ **GitHub.com Fallback** ⚠️