From 0074b9ca114104a28795edccc2330a05ad773f6f Mon Sep 17 00:00:00 2001 From: Sybille Peters Date: Tue, 12 Jul 2022 16:27:42 +0200 Subject: [PATCH] Add additional headers to FlashMessage page (#1944) * Add additional headers to FlashMessage page Previously, a large content block was under "Message severities" which was primarily not related to the severities. Now, additional headers have been added for the sections. * Fix typos Co-authored-by: Lina Wolf <48202465+linawolf@users.noreply.github.com> * Fix typos Co-authored-by: Lina Wolf <48202465+linawolf@users.noreply.github.com> * Use FlashMessage Co-authored-by: Lina Wolf <48202465+linawolf@users.noreply.github.com> * Use FlashMessage Co-authored-by: Lina Wolf <48202465+linawolf@users.noreply.github.com> * Use FlashMessage Co-authored-by: Lina Wolf <48202465+linawolf@users.noreply.github.com> * Fix header underlines * Fix conflict resolution Co-authored-by: Lina Wolf <48202465+linawolf@users.noreply.github.com> --- .../ApiOverview/FlashMessages/Index.rst | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/Documentation/ApiOverview/FlashMessages/Index.rst b/Documentation/ApiOverview/FlashMessages/Index.rst index d2cccb2a2e..a4b17cb2cd 100644 --- a/Documentation/ApiOverview/FlashMessages/Index.rst +++ b/Documentation/ApiOverview/FlashMessages/Index.rst @@ -37,6 +37,9 @@ The different severity levels are described below: Flash messages API ================== +Instantiate a flash message +--------------------------- + Creating a flash message is achieved by simply instantiating an object of class :php:`\TYPO3\CMS\Core\Messaging\FlashMessage` @@ -84,6 +87,14 @@ The severity is defined by using class constants provided by * :php:`FlashMessage::ERROR` for errors +The fourth parameter passed to the constructor is a flag that +indicates whether the message should be stored in the session or not (the +default is not). Storage in the session should be used if you need the +message to be still present after a redirection. + +Add a flash message to the queue +-------------------------------- + In backend modules you can then make that message appear on top of the module after a page refresh or the rendering of the next page request or render it on your own where ever you want. @@ -138,11 +149,10 @@ as top-right notifications, instead of inline: ); $notificationQueue->enqueue($flashMessage); -The recommend way to show flash messages is to use the Fluid Viewhelper :html:``. -This Viewhelper works in any context because it use the :php:`FlashMessageRendererResolver` class +The recommended way to show flash messages is to use the Fluid ViewHelper :html:``. +This ViewHelper works in any context because it use the :php:`FlashMessageRendererResolver` class to find the correct renderer for the current context. - .. _flash-messages-renderer: Flash messages renderer