---
title: "ModifyPluginViewEvent"
manual: "Academic Profiles"
version: "main"
permalink: "https://docs.typo3.org/permalink/fgtclb/academic-persons:developers-event-modify-plugin-view-event@main"
source: "Developers/Events/ModifyPluginViewEvent.rst"
rendered: "2026-10-15T10:24:29+00:00"
---

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

`\FGTCLB\AcademicBase\Event\ModifyPluginViewEvent` belongs to
**academic_base**, and the plugins of seven academic extensions
dispatch it when they render. A listener assigns further variables to the
view, which the templates, partials and sections of the plugin then render.
The event, its contract and an example are documented in the [manual of
academic_base](https://docs.typo3.org/p/fgtclb/academic-base/main/en-us/Developers/Events/ModifyPluginViewEvent.html).
This page describes what the plugins of this extension pass in.

## When it is dispatched {#when-it-is-dispatched}

Every plugin of this extension dispatches the event once each time an action
renders its view, after the action assigned its own variables:

| Plugin name | Action | Dispatched |
| --- | --- | --- |
| `List`, `ListAndDetail` | `list` | after the profile query, the pagination and the letters |
| `ListAndDetail`, `Detail` | `detail` | after the page title was set |
| `Card` | `card` | after the query of the selected profiles |
| `SelectedProfiles` | `selectedProfiles` | after the query of the selection, and also while the selection is empty |
| `SelectedContracts` | `selectedContracts` | after the query of the selection, and also while the selection is empty |

The filter form of the list posts to the action `filter`, which redirects
to the list and renders nothing, so it dispatches no event. A detail view of a
profile that does not exist answers with the page-not-found response before
the event.

## What this extension passes in {#what-this-extension-passes-in}

`getPluginControllerActionContext()` returns the context the queries of
the same rendering received: the extension name `AcademicPersons`, the
plugin and action names above, the settings of the content element and the
request. See [The plugin action context](https://docs.typo3.org/permalink/fgtclb/academic-persons:developers-plugin-action-context@main). While a letter is
selected, the setting `paginationEnabled` of that context is `'0'`, because
a letter switches the pagination off.

`getView()` holds the variables the action assigned:

| Action | Variables |
| --- | --- |
| `list` | `profiles`, `demand`, `activeListArguments`, `filterOptions`, `data`, `record`, `viewMode`, `viewModePartial`, `viewModes`, `defaultViewMode`, plus `paginator` and `pagination` while the pagination is on, and `alphabetFilterLetters` while the letter navigation is on and no profiles are selected by hand |
| `detail` | `profile`, `publicProfile`, `data`, `record` |
| `card` | `profiles`, `data`, `record` |
| `selectedProfiles` | `profiles` while profiles are selected, `data`, `record`, `viewMode`, `viewModePartial`, `viewModes`, `defaultViewMode` |
| `selectedContracts` | `contracts` while contracts are selected, `data`, `record`, `viewMode`, `viewModePartial`, `viewModes`, `defaultViewMode` |

## Example {#example}

A site links the detail view of every profile to a page with an appointment
form. The page is a site setting of the site package,
`mySitepackage.appointmentPage`, and the listener hands its uid to the
detail templates as `appointmentPageUid`:

**EXT:my_sitepackage/Classes/EventListener/AddAppointmentPage.php**

```php
<?php

declare(strict_types=1);

namespace MyVendor\MySitepackage\EventListener;

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

final class AddAppointmentPage
{
    #[AsEventListener(identifier: 'my-sitepackage/add-appointment-page')]
    public function __invoke(ModifyPluginViewEvent $event): void
    {
        $context = $event->getPluginControllerActionContext();
        if ($context->getControllerExtensionName() !== 'AcademicPersons'
            || $context->getActionName() !== 'detail'
        ) {
            return;
        }
        $appointmentPage = (int)$context->getSite()?->getSettings()->get('mySitepackage.appointmentPage', 0);
        if ($appointmentPage > 0) {
            $event->getView()->assign('appointmentPageUid', $appointmentPage);
        }
    }
}
```

A template override of the detail view renders the link with
`<f:link.page pageUid="{appointmentPageUid}">`.

## Rules and pitfalls {#rules-and-pitfalls}

-   Check the extension name and the action name, or the plugin name. Every
    academic plugin dispatches the same event, and plugin names repeat
    between extensions.
-   A variable the listener assigns again replaces the one of the action in
    the view, and only there. The pagination, the letters of the letter
    navigation and the page title keep what the query returned. Replacing
    `profiles` of a paginated list changes nothing the visitor sees, because
    the template renders the items of `paginator`. Which profiles are shown
    belongs in [ModifyProfileDemandEvent](https://docs.typo3.org/permalink/fgtclb/academic-persons:developers-event-modify-profile-demand-event@main) or
    [ModifyProfileQueryEvent](https://docs.typo3.org/permalink/fgtclb/academic-persons:developers-event-modify-profile-query-event@main).
-   The event carries no profile data of its own. A listener reads the
    profile of the detail view from its view variable `profile`.

## Introduced in {#introduced-in}

-   [Feature: The plugins dispatch the plugin view event](https://docs.typo3.org/permalink/fgtclb/academic-persons:feature-plugin-view-event@main) made the plugins of this extension
    dispatch the event.
-   [Breaking: The list, detail and selection events of the plugins are gone](https://docs.typo3.org/permalink/fgtclb/academic-persons:breaking-removed-profile-view-events@main) replaced the list, detail,
    selected profiles and selected contracts events with it.
-   [Important: The profile queries see a letter switching off the pagination](https://docs.typo3.org/permalink/fgtclb/academic-persons:important-1790607226@main) hands it the context the queries receive.
