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 

Deprecated since version 14.0

The public constants in InfoboxViewHelper for defining the state/severity of an infobox have been deprecated. Use the enum \TYPO3\CMS\Core\Type\ContextualFeedbackSeverity instead.

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.

The state property allows enums of type \TYPO3\CMS\Core\Type\ContextualFeedbackSeverity and integer values between -2 and +2 for backward compatibility.

A screenshot demonstrating all possible infobox colors and states.

A demonstration of all possible states

ContextualFeedbackSeverity::NOTICE (-2)
Notices (Default)
ContextualFeedbackSeverity::INFO (-1)
Information
ContextualFeedbackSeverity::OK (0)
Positive feedback
ContextualFeedbackSeverity::WARNING (1)
Warnings
ContextualFeedbackSeverity::ERROR (2)
Error

It is considered best practice to use the states from \TYPO3\CMS\Core\Type\ContextualFeedbackSeverity enum 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\Core\Type\ContextualFeedbackSeverity::NOTICE')}"
/>
<f:be.infobox
    title="Some Notice"
    message="The message"
    state="{f:constant(name: '\TYPO3\CMS\Core\Type\ContextualFeedbackSeverity::INFO')}"
/>
<f:be.infobox
    title="Some sucess message"
    message="The message"
    state="{f:constant(name: '\TYPO3\CMS\Core\Type\ContextualFeedbackSeverity::OK')}"
/>
<f:be.infobox
    title="Some Warning"
    message="The message"
    state="{f:constant(name: '\TYPO3\CMS\Core\Type\ContextualFeedbackSeverity::WARNING')}"
/>
<f:be.infobox
    title="Some Error"
    message="The message"
    state="{f:constant(name: '\TYPO3\CMS\Core\Type\ContextualFeedbackSeverity::ERROR')}"
/>
Copied!

Examples of be.infobox ViewHelper usage 

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\Core\Type\ContextualFeedbackSeverity::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\Core\Type\ContextualFeedbackSeverity::OK')}"
    iconName="check"
/>
Copied!

Migration from using InfoboxViewHelper state constants 

If you want to support both TYPO3 v13 and v14 you can keep using the constants until dropping TYPO3 13 support.

After dropping TYPO3 13 support migrate as follows:

EXT:my_extension/Resources/Private/Backend/Templates/MyModule.html
 <f:be.infobox title="Error!"
-              state="{f:constant(name: 'TYPO3\CMS\Fluid\ViewHelpers\Be\InfoboxViewHelper::STATE_ERROR')}">
+              state="{f:constant(name: 'TYPO3\CMS\Core\Type\ContextualFeedbackSeverity::ERROR')}">
     Error message
 </f:be.infobox>
Copied!

In PHP code replace the severity by using the enum or their value instead of the constants:

EXT:my_extension/Classes/Controller/MyController.php
<?php

// Before
use TYPO3\CMS\Fluid\ViewHelpers\Be\InfoboxViewHelper;

$state = InfoboxViewHelper::STATE_ERROR;

// After - Recommended: Use the enum directly
use TYPO3\CMS\Core\Type\ContextualFeedbackSeverity;

$state = ContextualFeedbackSeverity::ERROR;

// Alternative: Use the integer value when explicitly needed
$stateValue = ContextualFeedbackSeverity::ERROR->value;
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
mixed
Default
-2
The state of the box, accepts ContextualFeedbackSeverity enum or integer value

title

title
Type
string
The title of the info box