contextualcode/ezplatform-content-disposition-bundle

eZ Platform bundle that gives the ability to specify content dispositions for downloads.


Keywords
content, inline, download, attachment, ezplatform, disposition
License
GPL-3.0-only

Documentation

ContextualCode\EzPlatformContentDispositionBundle

This bundle gives the ability to customize content dispositions (inline or attachment) for downloads.

You can specify the default content disposition, and content dispositions per mime type.

Installation

  • Run composer require:
$ composer require contextualcode/ezplatform-content-disposition-bundle
  • Enable this bundle in app/AppKernel.php by adding this line in the registerBundles method:
    public function registerBundles()
    {
        $bundles = array(
            ...
            new ContextualCode\EzPlatformContentDispositionBundle\ContextualCodeEzPlatformContentDispositionBundle(),
        );
    }

Usage

In some parameters.yml file, you can specify:

  • A default content disposition:

    ezsettings.global.download_content_disposition.default: inline
    
  • A content disposition per mimetype:

    ezsettings.global.download_content_disposition.mimetype:
      "application/pdf": inline
      "application/msword": attachment