PHPackages                             heimrichhannot/contao-filecredits - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Image &amp; Media](/categories/media)
4. /
5. heimrichhannot/contao-filecredits

AbandonedArchivedContao-module[Image &amp; Media](/categories/media)

heimrichhannot/contao-filecredits
=================================

Contao module that adds credit support for images.

3.5.1(6y ago)52.7k3[1 PRs](https://github.com/heimrichhannot/contao-filecredits/pulls)LGPL-3.0+PHPPHP ~5.4 || ~7.0

Since Dec 10Pushed 1y ago8 watchersCompare

[ Source](https://github.com/heimrichhannot/contao-filecredits)[ Packagist](https://packagist.org/packages/heimrichhannot/contao-filecredits)[ Docs](https://github.com/heimrichhannot/contao-filecredits)[ RSS](/packages/heimrichhannot-contao-filecredits/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (6)Versions (68)Used By (0)

Caution

**ABANDONED**

This module has reached its end of life and will undergo no further development.

Refer to the recommended replacement, which is also available for Contao 5 as of v2.

[heimrichhannot/contao-filecredits-bundle](https://github.com/heimrichhannot/contao-filecredits-bundle)

---

Filecredits
===========

[](#filecredits)

Contao module that adds credit support for images and files.

Installation
------------

[](#installation)

```
composer require heimrichhannot/contao-filecredits

```

### Disable command scheduler (poor-mans-cron)

[](#disable-command-scheduler-poor-mans-cron)

For performance reasons, we insist on disabling the "Command-Scheduler" (enable `tl_settings.disableCron`) and run the cron jobs by a dedicated cronjob within your servers crontab.

- Contao 4: `* * * * * wget -O /dev/null -q https://[DOMAIN-NAME]/_contao/cron --no-check-certificate`
- Contao 3: `* * * * * wget -O /dev/null -q https://[DOMAIN-NAME]/system/cron/cron.php --no-check-certificate`

### Use custom cron job (contao 4)

[](#use-custom-cron-job-contao-4)

```
0 3 * * * /path/to/contao/vendor/heimrichhannot/contao-filecredits/bin/indexer # every day at 03:00

```

### Use custom cron job (contao 3)

[](#use-custom-cron-job-contao-3)

```
0 3 * * * /path/to/contao/composer/vendor/heimrichhannot/contao-filecredits/bin/indexer # every day at 03:00

```

Filecredits 3.x
---------------

[](#filecredits-3x)

Filecredits 3 yields an huge performance due to credit index within cron job only. Filecredits makes usage of `executeResize` Hook, which is triggered every time an image is resized. If you use responsive images this Hook will be triggered not only once, but for every src-set provided. Filecredit 2.x invoked the hook within every client request, which braked down your website performance, based on number of images per page. Filecredit 3 now triggers a daily poor mans cron, or you can declare your own cron job within crontab, see Installation.

Filecredits 2.x
---------------

[](#filecredits-2x)

Filecredits 2.x is a complete redevelopment. If you attached your custom modules to filecredits 1.x, we would not recommend to upgrade.

Features
--------

[](#features)

- Copyrights can be added directly at the file within the contao file manager
- Page occurrences for images will be added automatically, on rebuild search index, or when the page with the image will be loaded
- A backend module is available to add custom filecredits with multiple page occurrences.
- A copyright field can be added to any DCA as a shortcut to add copyrights directly to a file without having to go to the file manager

Technical instructions
----------------------

[](#technical-instructions)

### Adding a copyright field to a non-tl\_files-DCA

[](#adding-a-copyright-field-to-a-non-tl_files-dca)

If you want to get a shortcut copyright field next to e.g. some image field you can do this by calling the following code e.g. in your DCA:

```
\HeimrichHannot\FileCredit\FileCredit::addCopyrightFieldToDca(
