Skip to content

Latest commit

 

History

History

Download (v1)

Download component written in HTL that displays a downloadable asset on the page.

Features

  • Displays an asset on the page for download with the following elements:
    • Title
    • Description
    • File Size, File Format, Filename
    • Action
  • Optionally allows assets to be displayed inline in the browser rather than directly downloaded.
  • Direct upload from a local file system is configurable.
  • Download Servlet with support for conditional header information and Content-Disposition.
  • Style System support.

Use Object

The Download component uses the com.adobe.cq.wcm.core.components.models.Download Sling model as its Use-object.

Component Policy Configuration Properties

The following configuration properties are used:

  1. ./allowUpload - defines whether direct upload from a local file system is allowed.
  2. ./titleType - defines the HTML element to use for the download title.
  3. ./displaySize - defines whether the file size should be displayed.
  4. ./displayFormat - defines whether the file format should be displayed.
  5. ./displayFilename - defines whether the filename should be displayed.
  6. ./hideTitleLink - defines whether the title link should be hidden.

Edit Dialog Properties

The following JCR properties are used:

  1. ./fileReference - defines the path to the asset from DAM.
  2. ./inline - defines whether the download item should be displayed inline in the browser vs. attachment.
  3. ./jcr:title - defines the download title.
  4. ./titleFromAsset - defines whether the title should be taken from the DAM asset title.
  5. ./jcr:description - defines the download description.
  6. ./descriptionFromAsset - defines whether the description should be taken from the DAM asset description.
  7. ./actionText - defines the action text.
  8. ./id - defines the component HTML ID attribute.

BEM Description

BLOCK cmp-download
    ELEMENT cmp-download__title
    ELEMENT cmp-download__title-link
    ELEMENT cmp-download__description
    ELEMENT cmp-download__properties
    ELEMENT cmp-download__property
        MOD cmp-download__property--<property>
    ELEMENT cmp-download__property-label
    ELEMENT cmp-download__property-content
    ELEMENT cmp-download__action
    ELEMENT cmp-download__action-text

Information

If you were involved in the authoring of this component and are not credited above, please reach out to us on GitHub.