LanguageMenuProcessor

class \TYPO3\CMS\Frontend\DataProcessing\LanguageMenuProcessor

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  : mixed = ['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
$menuContentObjectFactory  : MenuContentObjectFactory
$menuDefaults  : array
$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 mixed 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.']

$menuConfig

protected array $menuConfig = []

$menuDefaults

protected array $menuDefaults = ['as' => 'languagemenu']

$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

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

string

getCurrentSite()

Returns the currently configured "site" if a site is configured (= resolved) in the current request.

protected getCurrentSite() : Site

Return values

Site

getRequest()

protected getRequest() : ServerRequestInterface

Return values

ServerRequestInterface

prepareConfiguration()

Process languages and filter the configuration

protected prepareConfiguration() : void

validateConfiguration()

protected validateConfiguration() : void

Tags

throws
InvalidArgumentException
On this page