PageLayoutController

The Content > Layout module.

Internal

This class is not part of the TYPO3 API.

Attributes
#[AsController]

Table of Contents

Properties

$backendLayoutRenderer  : BackendLayoutRenderer
$backendLayoutView  : BackendLayoutView
$componentFactory  : ComponentFactory
$connectionPool  : ConnectionPool
$eventDispatcher  : EventDispatcherInterface
$iconFactory  : IconFactory
$languageSelectorBuilder  : LanguageSelectorBuilder
$moduleData  : ModuleData|null
$moduleProvider  : ModuleProvider
$moduleTemplateFactory  : ModuleTemplateFactory
$pageContext  : PageContext
$pageLinkMessageProvider  : PageLinkMessageProvider
$pageRenderer  : PageRenderer
$pageRepository  : PageRepository
$schema  : TcaSchema|null
$tcaSchemaFactory  : TcaSchemaFactory
$uriBuilder  : UriBuilder

Methods

__construct()  : mixed
mainAction()  : ResponseInterface
addButtonsToButtonBar()  : void
createLanguageSelector()  : void
Creates the language selector dropdown in the module toolbar.
createPageLayoutContext()  : PageLayoutContext
createViewModeSelection()  : void
Creates the menu dropdown for switching between view modes.
generateMessagesForCurrentPage()  : array<string|int, mixed>
Return an array of various messages for the current page record, such as if the page has a special doktype, that can be rendered as info boxes.
getBackendUser()  : BackendUserAuthentication
getLanguageService()  : LanguageService
getNumberOfHiddenElements()  : int
Returns the number of hidden elements (including those hidden by start/end times) on the current page (for the current site language)
getPageLinksWhereContentIsAlsoShownOn()  : string
Get all pages with links where the content of a page $pageId is also shown on.
getTargetPageIfVisible()  : array<string|int, mixed>
Returns the target page if visible
initializeClipboard()  : void
isContentEditable()  : bool
Check if content can be edited by current user
isPageEditable()  : bool
Check if page can be edited by current user.
makeEditButton()  : ButtonInterface|null
Edit Button
makeViewButton()  : ButtonInterface|null
View Button
updateModuleData()  : void

Properties

$eventDispatcher read-only

protected EventDispatcherInterface $eventDispatcher

Methods

__construct()

public __construct(ComponentFactory $componentFactory, IconFactory $iconFactory, PageRenderer $pageRenderer, UriBuilder $uriBuilder, PageRepository $pageRepository, ModuleTemplateFactory $moduleTemplateFactory, EventDispatcherInterface $eventDispatcher, ModuleProvider $moduleProvider, BackendLayoutRenderer $backendLayoutRenderer, BackendLayoutView $backendLayoutView, TcaSchemaFactory $tcaSchemaFactory, ConnectionPool $connectionPool, LanguageSelectorBuilder $languageSelectorBuilder, PageLinkMessageProvider $pageLinkMessageProvider) : mixed
Parameters
$componentFactory : ComponentFactory
$iconFactory : IconFactory
$pageRenderer : PageRenderer
$uriBuilder : UriBuilder
$pageRepository : PageRepository
$moduleTemplateFactory : ModuleTemplateFactory
$eventDispatcher : EventDispatcherInterface
$moduleProvider : ModuleProvider
$backendLayoutRenderer : BackendLayoutRenderer
$backendLayoutView : BackendLayoutView
$tcaSchemaFactory : TcaSchemaFactory
$connectionPool : ConnectionPool
$languageSelectorBuilder : LanguageSelectorBuilder
$pageLinkMessageProvider : PageLinkMessageProvider

mainAction()

public mainAction(ServerRequestInterface $request) : ResponseInterface
Parameters
$request : ServerRequestInterface
Return values
ResponseInterface

addButtonsToButtonBar()

protected addButtonsToButtonBar(ModuleTemplate $view, ServerRequestInterface $request) : void
Parameters
$view : ModuleTemplate
$request : ServerRequestInterface

createLanguageSelector()

Creates the language selector dropdown in the module toolbar.

protected createLanguageSelector(ModuleTemplate $view) : void
Parameters
$view : ModuleTemplate

createViewModeSelection()

Creates the menu dropdown for switching between view modes.

protected createViewModeSelection(ModuleTemplate $view) : void

Available actions:

  • LayoutView: Single-language content editing (always available)
  • LanguageComparisonView: Multi-language comparison (only if translations exist)

Smart Language Selection: When building URLs for mode switching, this method implements smart language selection:

  • Switching to layout mode with 1 translation selected → keep that translation
  • Switching to layout mode with 2+ translations selected → show default
Parameters
$view : ModuleTemplate

generateMessagesForCurrentPage()

Return an array of various messages for the current page record, such as if the page has a special doktype, that can be rendered as info boxes.

protected generateMessagesForCurrentPage(ServerRequestInterface $request) : array<string|int, mixed>
Parameters
$request : ServerRequestInterface
Return values
array<string|int, mixed>

getNumberOfHiddenElements()

Returns the number of hidden elements (including those hidden by start/end times) on the current page (for the current site language)

protected getNumberOfHiddenElements() : int
Return values
int

getPageLinksWhereContentIsAlsoShownOn()

Get all pages with links where the content of a page $pageId is also shown on.

protected getPageLinksWhereContentIsAlsoShownOn(int $pageId) : string
Parameters
$pageId : int
Return values
string

getTargetPageIfVisible()

Returns the target page if visible

protected getTargetPageIfVisible(array<string|int, mixed> $targetPage) : array<string|int, mixed>
Parameters
$targetPage : array<string|int, mixed>
Return values
array<string|int, mixed>

initializeClipboard()

protected initializeClipboard(ServerRequestInterface $request) : void
Parameters
$request : ServerRequestInterface

isContentEditable()

Check if content can be edited by current user

protected isContentEditable(int $languageId) : bool
Parameters
$languageId : int
Return values
bool

isPageEditable()

Check if page can be edited by current user.

protected isPageEditable(int $languageId) : bool
Parameters
$languageId : int
Return values
bool

updateModuleData()

protected updateModuleData() : void

        
On this page

Search results