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

Properties

$allowedConfigurationKeys  : array<string|int, mixed>
Allowed configuration keys for menu generation, other keys will throw an exception to prevent configuration errors.
$cObj  : ContentObjectRenderer
$menuConfig  : array<string|int, mixed>
$menuContentObjectFactory  : MenuContentObjectFactory
$menuDefaults  : array<string|int, mixed>
$processorConfiguration  : array<string|int, mixed>
$removeConfigurationKeysForHmenu  : array<string|int, mixed>
Remove keys from configuration that should not be passed to the menu to prevent configuration errors

Methods

__construct()  : mixed
process()  : array<string|int, mixed>
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

Properties

$allowedConfigurationKeys

Allowed configuration keys for menu generation, other keys will throw an exception to prevent configuration errors.

protected array<string|int, mixed> $allowedConfigurationKeys = ['if', 'if.', 'languages', 'languages.', 'as', 'addQueryString', 'addQueryString.']

$menuConfig

protected array<string|int, mixed> $menuConfig = ['special' => 'language', 'addQueryString' => 1]

$menuDefaults

protected array<string|int, mixed> $menuDefaults = ['as' => 'languagemenu']

$processorConfiguration

protected array<string|int, mixed> $processorConfiguration

$removeConfigurationKeysForHmenu

Remove keys from configuration that should not be passed to the menu to prevent configuration errors

protected array<string|int, mixed> $removeConfigurationKeysForHmenu = ['languages', 'languages.', 'as']

Methods

process()

Process content object data

public process(ContentObjectRenderer $cObj, array<string|int, mixed> $contentObjectConfiguration, array<string|int, mixed> $processorConfiguration, array<string|int, mixed> $processedData) : array<string|int, mixed>
Parameters
$cObj : ContentObjectRenderer

The data of the content element or page

$contentObjectConfiguration : array<string|int, mixed>

The configuration of Content Object

$processorConfiguration : array<string|int, mixed>

The configuration of this processor

$processedData : array<string|int, mixed>

Key/value store of processed data (e.g. to be passed to a Fluid View)

Return values
array<string|int, mixed>

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

Search results