‪TYPO3CMS  ‪main
TYPO3\CMS\Core\Page\PageLayoutResolver Class Reference

Public Member Functions

 __construct (protected readonly DataProviderCollection $dataProviderCollection, protected readonly SiteFinder $siteFinder, protected readonly PageTsConfigFactory $pageTsConfigFactory)
 
 getLayoutForPage (array $pageRecord, array $rootLine)
 
 getLayoutIdentifierForPage (array $page, array $rootLine)
 
 getLayoutIdentifierForPageWithoutPrefix (array $page, array $rootLine)
 

Detailed Description

Finds the proper layout for a page, using the database fields "backend_layout" and "backend_layout_next_level".

The most crucial part is that "backend_layout" is only applied for the CURRENT level, whereas backend_layout_next_level.

Used in TypoScript as "getData:pagelayout".

Currently, there is a hard dependency on EXT:backend however, all DataProvider logic should be migrated towards EXT:core.

This is not part of TYPO3 Core API.

Definition at line 41 of file PageLayoutResolver.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Core\Page\PageLayoutResolver::__construct ( protected readonly DataProviderCollection  $dataProviderCollection,
protected readonly SiteFinder  $siteFinder,
protected readonly PageTsConfigFactory  $pageTsConfigFactory 
)

Definition at line 43 of file PageLayoutResolver.php.

References $GLOBALS, and TYPO3\CMS\Webhooks\Message\$identifier.

Member Function Documentation

◆ getLayoutForPage()

TYPO3\CMS\Core\Page\PageLayoutResolver::getLayoutForPage ( array  $pageRecord,
array  $rootLine 
)

◆ getLayoutIdentifierForPage()

TYPO3\CMS\Core\Page\PageLayoutResolver::getLayoutIdentifierForPage ( array  $page,
array  $rootLine 
)

Check if the current page has a value in the DB field "backend_layout" if empty, check the root line for "backend_layout_next_level" Same as TypoScript: field = backend_layout ifEmpty.data = levelfield:-2, backend_layout_next_level, slide ifEmpty.ifEmpty = default

Definition at line 102 of file PageLayoutResolver.php.

Referenced by TYPO3\CMS\Core\Page\PageLayoutResolver\getLayoutForPage(), and TYPO3\CMS\Core\Page\PageLayoutResolver\getLayoutIdentifierForPageWithoutPrefix().

◆ getLayoutIdentifierForPageWithoutPrefix()

TYPO3\CMS\Core\Page\PageLayoutResolver::getLayoutIdentifierForPageWithoutPrefix ( array  $page,
array  $rootLine 
)