BeforeSectionMarkupGeneratedEvent 

Deprecated since version 14.3

The event BeforeSectionMarkupGeneratedEvent is deprecated and will be removed in TYPO3 v15. Existing listeners will keep working in v14. There is no direct replacement so listeners that decorated backend layout columns with this event should be removed.

The PSR-14 event \TYPO3\CMS\Backend\View\Event\BeforeSectionMarkupGeneratedEvent allows extension authors to display content in any colPos before the first content element.

Example 

EXT:my_extension/Classes/Backend/EventListener/MyEventListener.php
<?php

declare(strict_types=1);

namespace MyVendor\MyExtension\Backend\EventListener;

use TYPO3\CMS\Backend\View\Event\BeforeSectionMarkupGeneratedEvent;
use TYPO3\CMS\Core\Attribute\AsEventListener;

#[AsEventListener(
    identifier: 'my-extension/before-section-markup-generated',
)]
final readonly class MyEventListener
{
    public function __invoke(BeforeSectionMarkupGeneratedEvent $event): void
    {
        // Check for relevant backend layout
        if ($event->getPageLayoutContext()->getBackendLayout()->getIdentifier() !== 'someBackendLayout') {
            return;
        }

        // Check for relevant column
        if ($event->getColumnConfig()['identifier'] !== 'someColumn') {
            return;
        }

        $event->setContent('
            <div class="t3-page-ce">
                <div class="t3-page-ce-element">
                    <div class="t3-page-ce-header">
                        <div class="t3-page-ce-header-title">
                            Some content at the start of the column
                        </div>
                    </div>
                </div>
            </div>
        ');
    }
}
Copied!

API 

class BeforeSectionMarkupGeneratedEvent
Fully qualified name
\TYPO3\CMS\Backend\View\Event\BeforeSectionMarkupGeneratedEvent

This event can be triggered to display content in any colPos before the first content element.

getColumnConfig ( )
Returns
array
getPageLayoutContext ( )
Returns
TYPO3CMSBackendViewPageLayoutContext
getRecords ( )
Returns
RecordInterface[]
setContent ( string $content = '')
param $content

the content, default: ''

getContent ( )
Returns
string
isPropagationStopped ( )

Prevent other listeners from being called if rendering is stopped by listener.

Returns
bool
setStopRendering ( bool $stopRendering)
param $stopRendering

the stopRendering