Feature: #88791 - Introduce PreviewAspect in Context

See forge#88791


A PreviewAspect for handling the preview flag has been introduced. This aspect may be used to indicate that the frontend is in preview mode (for example in case a workspace is previewed or hidden pages or records should be shown).


The Context API has a new Aspect called "frontend.preview". It can be used to determine whether the frontend is currently in preview mode.

GeneralUtility::makeInstance(Context::class)->getPropertyFromAspect('frontend.preview', 'isPreview');

This Aspect replaces the now deprecated property TypoScriptFrontendController->fePreview. Accessing this property triggers a PHP E_USER_DEPRECATED error, and fetches the information from the new Context Aspect instead.