Be.infobox ViewHelper <f:be.infobox>

A screenshot demonstrating a complex infobox with HTML content

See example Infobox with HTML content, icon and links

ViewHelper for rendering a styled content infobox markup.

Go to the source code of this ViewHelper: Be\InfoboxViewHelper.php (GitHub).

Severity states of the Be.infobox ViewHelper

The Infobox provides different context-sensitive states that can be used to provide an additional visual feedback to the

user to underline the meaning of the information.

Possible values are in range from -2 to 2. Please choose a meaningful value from the following list.

A screenshot demonstrating all possible infobox colors and states.

A demonstration of all possible states

-2
Notices (Default)
-1
Information
0
Positive feedback
1
Warnings
2
Error

It is considered best practice to use the states from \TYPO3\CMS\Fluid\ViewHelpers\Be\InfoboxViewHelper together with the Constant ViewHelper <f:constant>:

EXT:my_extension/Resources/Private/Backend/Templates/MyModule.html
<f:be.infobox
    title="Some Info"
    message="The message"
    state="{f:constant(name: 'TYPO3\CMS\Fluid\ViewHelpers\Be\InfoboxViewHelper::STATE_NOTICE')}"
/>
<f:be.infobox
    title="Some Notice"
    message="The message"
    state="{f:constant(name: 'TYPO3\CMS\Fluid\ViewHelpers\Be\InfoboxViewHelper::STATE_INFO')}"
/>
<f:be.infobox
    title="Some sucess message"
    message="The message"
    state="{f:constant(name: 'TYPO3\CMS\Fluid\ViewHelpers\Be\InfoboxViewHelper::STATE_OK')}"
/>
<f:be.infobox
    title="Some Warning"
    message="The message"
    state="{f:constant(name: 'TYPO3\CMS\Fluid\ViewHelpers\Be\InfoboxViewHelper::STATE_WARNING')}"
/>
<f:be.infobox
    title="Some Error"
    message="The message"
    state="{f:constant(name: 'TYPO3\CMS\Fluid\ViewHelpers\Be\InfoboxViewHelper::STATE_ERROR')}"
/>
Copied!

Examples

Info box of level notice with a static title and a static text:

EXT:my_extension/Resources/Private/Backend/Templates/MyModule.html
<f:be.infobox title="Message title">your box content</f:be.infobox>
Copied!

Warning box with disabled icon:

EXT:my_extension/Resources/Private/Backend/Templates/MyModule.html
<f:be.infobox
    title="Message title"
    message="your box content"
    state="{f:constant(name: 'TYPO3\CMS\Fluid\ViewHelpers\Be\InfoboxViewHelper::STATE_WARNING')}"
    disableIcon="true"
/>
Copied!

Success box with custom icon:

EXT:my_extension/Resources/Private/Backend/Templates/MyModule.html
<f:be.infobox
    title="Message title"
    message="your box content"
    state="{f:constant(name: 'TYPO3\CMS\Fluid\ViewHelpers\Be\InfoboxViewHelper::STATE_OK')}"
    iconName="check"
/>
Copied!

Arguments

disableIcon

disableIcon
Type
bool
Default
false
If set to TRUE, the icon is not rendered.

iconName

iconName
Type
string
Identifier of the icon as registered in the Icon Registry. NULL sets default icon

message

message
Type
string
The message of the info box, if NULL tag content is used

state

state
Type
int
Default
-2
The state of the box, InfoboxViewHelper::STATE_*

title

title
Type
string
The title of the info box