WorkspacePreview implements MiddlewareInterface uses CookieHeaderTrait

FinalYes

Middleware to - evaluate ADMCMD_prev as GET parameter or from a cookie - initializes the PreviewUser as $GLOBALS['BE_USER'] - renders a message about a possible workspace previewing currently

Internal

Table of Contents

Interfaces

MiddlewareInterface

Methods

__construct()  : mixed
process()  : ResponseInterface
Initializes a possible preview user (by checking for GET/cookie of name "ADMCMD_prev")
typoScriptDeterminedListener()  : void
This middleware is run pretty early in the FE chain to initialize correctly.

Methods

process()

Initializes a possible preview user (by checking for GET/cookie of name "ADMCMD_prev")

public process(ServerRequestInterface $request, RequestHandlerInterface $handler) : ResponseInterface

The GET parameter "ADMCMD_prev=LIVE" can be used to preview a live workspace from the backend even if the backend user is in a different workspace.

Additionally, if a workspace is previewed, an additional message text is shown.

Parameters
$request : ServerRequestInterface
$handler : RequestHandlerInterface
Return values
ResponseInterface

typoScriptDeterminedListener()

This middleware is run pretty early in the FE chain to initialize correctly.

public typoScriptDeterminedListener(AfterTypoScriptDeterminedEvent $event) : void

To render the preview information however, it depends on TypoScript 'config', which is not available in the incoming Request, yet. It thus listens on the AfterTypoScriptDeterminedEvent to determine its preview details.

Parameters
$event : AfterTypoScriptDeterminedEvent
Attributes
#[AsEventListener]
'typo3-workspaces/workspace-preview-middleware'

        
On this page

Search results