---
title: "ModifyPluginViewEvent"
manual: "Academic Jobs"
version: "main"
permalink: "https://docs.typo3.org/permalink/fgtclb/academic-jobs:developers-event-modify-plugin-view-event@main"
source: "Developers/Events/ModifyPluginViewEvent.rst"
rendered: "2026-10-26T19:20:26+00:00"
---

# ModifyPluginViewEvent {#developers-event-modify-plugin-view-event}

`\FGTCLB\AcademicBase\Event\ModifyPluginViewEvent` is owned by
**academic_base**, which describes it for the seven academic
extensions whose plugins dispatch it in [its developer chapter](https://docs.typo3.org/p/fgtclb/academic-base/main/en-us/Developers/Events/ModifyPluginViewEvent.html#developers-event-modify-plugin-view-event).
This page says what the plugins of **academic_jobs** hand to it.

## When it is dispatched {#developers-event-modify-plugin-view-event-dispatched}

Each of the three content elements dispatches the event once each time it
renders, after its action assigned its own variables. Submitting the form
renders nothing and dispatches no view event, the
[AfterSaveJobEvent](https://docs.typo3.org/permalink/fgtclb/academic-jobs:developers-event-after-save-job-event@main) serves it.

| Content element | Plugin name | Action | Variables assigned before the event |
| --- | --- | --- | --- |
| [Job List](https://docs.typo3.org/permalink/fgtclb/academic-jobs:integrator-job-list@main) | `List` | `list` | `{jobs}`, `{data}`, `{record}`, and while the pagination is enabled `{paginator}` and `{pagination}`. `{jobsWithHiddenDefaultRecord}` maps the uid of every listed job whose record in the default language is hidden to `true`. |
| [Job Details](https://docs.typo3.org/permalink/fgtclb/academic-jobs:integrator-job-details@main) | `Detail` | `show` | `{job}`, `{data}`, `{record}` |
| [Job Form](https://docs.typo3.org/permalink/fgtclb/academic-jobs:integrator-job-form@main) | `NewJobForm` | `new` | `{typeOptions}`, `{employmentTypeOptions}`, `{data}`, `{record}` |

The extension name of the context is `AcademicJobs`.

## What this extension passes in {#developers-event-modify-plugin-view-event-api}

| Method | Returns |
| --- | --- |
| `getPluginControllerActionContext()` | The context of the rendering plugin: the request, the site and its language, the content object, the plugin and action name and the settings of the plugin, the options of the content element over the TypoScript of `plugin.tx_academicjobs.settings`. |
| `getView()` | The view the action renders. A variable a listener assigns to it reaches the template and its partials. |

## Example: a privacy page next to the job form {#developers-event-modify-plugin-view-event-example}

A site links its privacy statement above the submit button of the job form.
The page differs per site, so the site package declares a site setting for it,
and a listener hands the page to the form. A template override of
`Job/Forms/AdditionalFields.html` renders the link with
`{privacyPageId}`, see [Add a field to the new job form](https://docs.typo3.org/permalink/fgtclb/academic-jobs:templates-override-new-job-form@main).

**EXT:my_extension/Classes/EventListener/AddPrivacyPageToJobForm.php**

```php
<?php

declare(strict_types=1);

namespace MyVendor\MyExtension\EventListener;

use FGTCLB\AcademicBase\Event\ModifyPluginViewEvent;
use TYPO3\CMS\Core\Attribute\AsEventListener;

final class AddPrivacyPageToJobForm
{
    #[AsEventListener(identifier: 'my-extension/add-privacy-page-to-job-form')]
    public function __invoke(ModifyPluginViewEvent $event): void
    {
        $context = $event->getPluginControllerActionContext();
        if ($context->getControllerExtensionName() !== 'AcademicJobs'
            || $context->getPluginName() !== 'NewJobForm'
        ) {
            return;
        }
        $privacyPageId = (int)($context->getSite()?->getSettings()->get('mySitepackage.privacyPageId') ?? 0);
        $event->getView()->assign('privacyPageId', $privacyPageId);
    }
}
```

## Rules and pitfalls {#developers-event-modify-plugin-view-event-rules}

**The validations of the form cannot be replaced.** The job form assigns
`{validations}` after the event on purpose, so the required marks of the
form always match what the validation checks.

**Replacing the jobs of a paginated list changes nothing.** The paginator is
built from the jobs before the event, and a paginated list renders the page of
the paginator. Without the pagination, the list renders `{jobs}`, and a
listener that replaces it changes what is listed. Which jobs a list shows is
better decided by its options.

**The detail page is cached.** The listener runs when the page is rendered for
the cache, not for every visitor. The job list and the job form are not cached
and run it on every request.

## Introduced in {#developers-event-modify-plugin-view-event-introduced}

-   [Feature: The plugins dispatch the plugin view event](https://docs.typo3.org/permalink/fgtclb/academic-jobs:feature-plugin-view-event@main)
-   [Breaking: The view event of the new job form is gone](https://docs.typo3.org/permalink/fgtclb/academic-jobs:breaking-removed-job-new-action-view-event@main): the event replaces the
    view event of the job form.
-   [Feature: The job list can be paginated](https://docs.typo3.org/permalink/fgtclb/academic-jobs:feature-1790660966@main): the variables of the pagination.
