---
title: "ModifyPluginViewEvent"
manual: "Academic Partners"
version: "main"
permalink: "https://docs.typo3.org/permalink/fgtclb/academic-partners:developers-event-modify-plugin-view-event@main"
source: "Developers/Events/ModifyPluginViewEvent.rst"
rendered: "2026-10-26T19:20:19+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. It hands a listener the view of a plugin once the plugin has
assigned its own variables, so a listener adds a variable to the templates
without replacing the controller. The event itself, and the rules that apply to
every plugin, are described on [its page in the manual of academic_base](https://docs.typo3.org/p/fgtclb/academic-base/main/en-us/Developers/Events/ModifyPluginViewEvent.html#developers-event-modify-plugin-view-event).
This page describes what the content elements of **academic_partners**
pass in.

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

All four content elements dispatch it once each time they render, as the last
step of their action:

| Content element | Plugin name | Action | Dispatched after |
| --- | --- | --- | --- |
| [Partner List](https://docs.typo3.org/permalink/fgtclb/academic-partners:integrator-partner-list@main) | `List` | `list` | [ModifyPartnerListEvent](https://docs.typo3.org/permalink/fgtclb/academic-partners:developers-event-modify-partner-list-event@main) and the pagination |
| [Partner Map](https://docs.typo3.org/permalink/fgtclb/academic-partners:integrator-partner-map@main) | `Map` | `map` | [ModifyPartnerListEvent](https://docs.typo3.org/permalink/fgtclb/academic-partners:developers-event-modify-partner-list-event@main) |
| [Partners Linked](https://docs.typo3.org/permalink/fgtclb/academic-partners:integrator-partnerships-list@main) | `PartnershipsList` | `partnershipsList` | reading the partnerships of the page |
| [Partner Logo Teaser](https://docs.typo3.org/permalink/fgtclb/academic-partners:integrator-partnerships-teaser@main) | `PartnershipsTeaser` | `partnershipsTeaser` | reading the partnerships of the page |

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

| Method | Returns |
| --- | --- |
| `getPluginControllerActionContext()` | The context of the content element: the extension name `AcademicPartners`, the plugin and action name of the table above, the request, the site and its language, the content object and the settings of the content element, its FlexForm merged over `plugin.tx_academicpartners.settings`. |
| `getView()` | The view, with the variables the action assigned. |

The variables a listener finds in the view:

| Content element | Variables |
| --- | --- |
| Partner List | `{partners}`, `{categories}`, `{demand}`, `{filterTypes}`, `{visitorSelection}`, `{data}`, `{record}`, and with the pagination enabled `{paginator}`, `{pagination}` and `{demandArguments}` |
| Partner Map | the same, without the pagination |
| Partners Linked, Partner Logo Teaser | `{partnerships}`, `{partnershipRoles}`, `{partnershipsWithoutRole}`, `{data}`, `{record}` |

## Example {#example}

A site shows a link to its page of all partners below the logo teaser of a
project page. The uid of that page is a site setting of the site package, and a
listener hands it to the template of the teaser:

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

```php
<?php

declare(strict_types=1);

namespace MyVendor\MyExtension\EventListener;

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

final class AddAllPartnersPageToTheTeaser
{
    #[AsEventListener(identifier: 'my-extension/add-all-partners-page-to-the-teaser')]
    public function __invoke(ModifyPluginViewEvent $event): void
    {
        $context = $event->getPluginControllerActionContext();
        if ($context->getControllerExtensionName() !== 'AcademicPartners'
            || $context->getPluginName() !== 'PartnershipsTeaser'
        ) {
            return;
        }
        $pageUid = (int)($context->getSite()?->getSettings()->get('myExtension.allPartnersPage') ?? 0);
        if ($pageUid > 0) {
            $event->getView()->assign('allPartnersPage', $pageUid);
        }
    }
}
```

An override of `Templates/Partner/PartnershipsTeaser.html` renders the
link with `<f:link.page pageUid="{allPartnersPage}">`.

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

**Check the extension name and the plugin name.** One listener receives the
event of every academic plugin that dispatches it. `List` is the plugin name of the partner
list and of plugins of other academic extensions, so the extension name tells
them apart.

**A replaced variable is replaced in the view only.** A listener that assigns
`{partners}` again changes what the template renders, not the pagination,
which was built from the partners before, nor the categories of the filter. A
change of which partners are shown belongs in
[ModifyPartnerListEvent](https://docs.typo3.org/permalink/fgtclb/academic-partners:developers-event-modify-partner-list-event@main).

**The partnership content elements are cached.** **Partners Linked**
and **Partner Logo Teaser** are rendered when the page is rendered, and
the page is cached with what the listener assigned, so a listener cannot assign
something different for different visitors there. The partner list and the map
are not cached, a listener runs on every request that renders them.

## Introduced in {#introduced-in}

-   [Feature: The plugins dispatch the plugin view event](https://docs.typo3.org/permalink/fgtclb/academic-partners:feature-plugin-view-event@main) made the four content elements dispatch
    the event.
