LanguageMenuProcessor
class \
- Implements
- DataProcessorInterface
This menu processor generates a language menu array that will be assigned to FLUIDTEMPLATE as variable.
Options: if - TypoScript if condition languages - A list of languages id's (e.g. 0,1,2) to use for the menu creation or 'auto' to load from system or site languages as - The variable to be used within the result
Example TypoScript configuration: 10 = TYPO3\CMS\Frontend\DataProcessing\LanguageMenuProcessor 10 { as = languagenavigation }
Table of Contents
Interfaces
- DataProcessorInterface
- Interface for data processor classes processing data from ContentObjectRenderer, used e.g. with the FLUIDTEMPLATE content object
Constants
- DEFAULT_MENU_CONFIG : array = ['special' => 'language', 'addQueryString' => 1]
Properties
- $allowedConfigurationKeys : array
- Allowed configuration keys for menu generation, other keys will throw an exception to prevent configuration errors.
- $cObj : ContentObjectRenderer
- $menuConfig : array
- $menuContentObjectLocator : ContainerInterface
- $menuDefaults : array
- $pageRepository : PageRepository
- $processorConfiguration : array
- $removeConfigurationKeysForHmenu : array
- Remove keys from configuration that should not be passed to the menu to prevent configuration errors
Methods
- __construct() : mixed
- process() : array
- Process content object data
- buildConfiguration() : void
- Build the menu configuration so it can be treated by TMENU
- getConfigurationValue() : string
- Get configuration value from processorConfiguration
- getCurrentSite() : Site
- Returns the currently configured "site" if a site is configured (= resolved) in the current request.
- getRequest() : ServerRequestInterface
- prepareConfiguration() : void
- Process languages and filter the configuration
- validateConfiguration() : void
Constants
DEFAULT_MENU_CONFIG
protected
array
DEFAULT_MENU_CONFIG
= ['special' => 'language', 'addQueryString' => 1]
Properties
$allowedConfigurationKeys
Allowed configuration keys for menu generation, other keys will throw an exception to prevent configuration errors.
protected
array
$allowedConfigurationKeys
= ['if', 'if.', 'languages', 'languages.', 'as', 'addQueryStri…Show the full value
['if', 'if.', 'languages', 'languages.', 'as', 'addQueryString', 'addQueryString.']
$cObj
protected
ContentObjectRenderer
$cObj
$menuConfig
protected
array
$menuConfig
= []
$menuContentObjectLocator read-only
protected
ContainerInterface
$menuContentObjectLocator
$menuDefaults
protected
array
$menuDefaults
= ['as' => 'languagemenu']
$pageRepository read-only
protected
PageRepository
$pageRepository
$processorConfiguration
protected
array
$processorConfiguration
$removeConfigurationKeysForHmenu
Remove keys from configuration that should not be passed to the menu to prevent configuration errors
protected
array
$removeConfigurationKeysForHmenu
= ['languages', 'languages.', 'as']
Methods
__construct()
public
__construct(ContainerInterface $menuContentObjectLocator, PageRepository $pageRepository) : mixed
Parameters
- $menuContentObjectLocator : ContainerInterface
- $pageRepository : PageRepository
process()
Process content object data
public
process(ContentObjectRenderer $cObj, array $contentObjectConfiguration, array $processorConfiguration, array $processedData) : array
Parameters
- $cObj : ContentObjectRenderer
-
The data of the content element or page
- $contentObjectConfiguration : array
-
The configuration of Content Object
- $processorConfiguration : array
-
The configuration of this processor
- $processedData : array
-
Key/value store of processed data (e.g. to be passed to a Fluid View)
Return values
array —the processed data as key/value store
buildConfiguration()
Build the menu configuration so it can be treated by TMENU
protected
buildConfiguration() : void
getConfigurationValue()
Get configuration value from processorConfiguration
protected
getConfigurationValue(string $key) : string
Parameters
- $key : string
Return values
stringgetCurrentSite()
Returns the currently configured "site" if a site is configured (= resolved) in the current request.
protected
getCurrentSite() : Site
Return values
SitegetRequest()
protected
getRequest() : ServerRequestInterface
Return values
ServerRequestInterfaceprepareConfiguration()
Process languages and filter the configuration
protected
prepareConfiguration() : void
validateConfiguration()
protected
validateConfiguration() : void