Update the project documentation page to include an inline example

Created on 13 June 2024, 5 months ago

Problem/Motivation

While working on a twig integration with some pdf file I was looking for a way to disable the default download behavior so browser could preview the pdf.

Proposed resolution

In the project page, it should be added an example like those ones :

You can specify the browser to display the file (inline) instead of downloading it (default module behavior)

Twig :

url('media_entity_download.download', {'media': media_id, 'inline': true})

PHP :

$url = Url::fromRoute(
  'media_entity_download.download',
  [
    'media' => $media_id,
    'inline' => true
  ]
);
📌 Task
Status

Active

Version

2.3

Component

Documentation

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024