t3/file-canonical

Canonical links for files, in TYPO3 CMS.

Installs: 249

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Type:typo3-cms-extension

dev-master 2021-03-21 18:50 UTC

This package is auto-updated.

Last update: 2021-04-21 18:57:54 UTC


README

This is an extension for TYPO3 CMS. It provides canonical links for files.

Screenshots

Extended sys_file_metadata TCA

Screenshot 1: Extended sys_file_metadata TCA

Additional HTTP response header "link"

Screenshot 2: Additional HTTP response header "link"

Info module overview

Screenshot 3: Info module overview

Installation

Download

composer req t3/file-canonical

Or fetch from TER.

Setup

After you've fetched and installed the file_canonical extension, like any other TYPO3 CMS extension, you need to adjust the configuration of your webserver.

Usually TYPO3 does not process files which are actually existing.

For Apache, you need to add the following contents to .htaccess file, right after the TYPO3_CONTEXT has been set:

# Rule for EXT:file_canonical
RewriteCond %{REQUEST_URI} ^/fileadmin
RewriteCond %{REQUEST_FILENAME} \.(pdf|docx|xlsx|pptx)$
RewriteRule ^.*$ %{ENV:CWD}index.php [QSA,L]

Now, all requests which point to /fileadmin and request a PDF or common office file, will be processed by the FileCanonicalMiddleware provided by this extension.

Extension settings

Extension settings of EXT:file_canonical

Usage

To enable canonical link for a file:

  1. Edit the file's metadata, in TYPO3 backend (see screenshot 1)
  2. Set a page or record, on which this file is located at
  3. After saving metadata, the canonical link get parsed and stored to database

Now, when requesting the file in Frontend, will add additional "Link" HTTP header (see screenshot 2).

Auto Canonical Link

The extension creates the canonical link automatically from HTTP referer, if enabled. (see Extension settings)

Roadmap

  • Add translations for locallang
  • Provide RST documentation
  • Publish in TER and on Packagist