---
title: "Feature: #97230 - PSR-14 event for modifying image manipulation preview URL"
manual: "TYPO3 Core Changelog"
version: "main"
permalink: "https://docs.typo3.org/permalink/changelog:feature-97230"
source: "Changelog/12.0/Feature-97230-PSR-14EventForModifyingImageManipulationPreviewUrl.rst"
typo3-version: "12.0"
typo3-major: 12
type: "feature"
issue: 97230
forge: "https://forge.typo3.org/issues/97230"
tags: ["Backend", "PHP-API", "ext:backend"]
rendered: "2026-09-20T18:31:11+00:00"
---

# Feature: #97230 - PSR-14 event for modifying image manipulation preview URL {#feature-97230}

See [forge#97230](https://forge.typo3.org/issues/97230)

## Description {#description}

A new PSR-14 event `\TYPO3\CMS\Backend\Form\Event\ModifyImageManipulationPreviewUrlEvent`
has been introduced which serves as a direct replacement for the now removed
`$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['Backend/Form/Element/ImageManipulationElement']['previewUrl']`
hook.

It can be used to modify the preview URL within the image manipulation element,
used e.g. for the `crop` field of the `sys_file_reference` table.

As soon as a preview URL is set, the image manipulation element will display
a corresponding button in the footer of the modal window, next to the
**Cancel** and **Accept** buttons. On click, the preview
URL will be opened in a new window.

> [!NOTE]
> The element's crop variants will always be appended to the preview URL
> as JSON-encoded string, using the `cropVariants` parameter.

Next to the `getPreviewUrl()` and `setPreviewUrl()` the new
PSR-14 event feature the following methods:

-   `getDatabaseRow()`: Returns the whole database row for the corresponding record
-   `getFieldConfiguration()`: Returns the processed field configuration
-   `getFile()`: Returns the resolved file object

## Example {#example}

Registration of the event in your extension's `Services.yaml`:

```yaml
MyVendor\MyPackage\Backend\MyEventListener:
  tags:
    - name: event.listener
      identifier: 'my-package/backend/modify-imagemanipulation-previewurl'
```

The corresponding event listener class:

```php
use TYPO3\CMS\Backend\Form\Event\ModifyImageManipulationPreviewUrlEvent;

final class MyEventListener
{
    public function __invoke(ModifyImageManipulationPreviewUrlEvent $event): void
    {
        $event->setPreviewUrl('https://example.com/some/preview/url');
    }
}
```

## Impact {#impact}

It's now possible to modify the preview URL for the image manipulation
element, using the new PSR-14 event `ModifyImageManipulationPreviewUrlEvent`.
