Render flashmessage in own plugin

Hey guys,

In my controller I render a flashmessage like
$this->addFlashMessage(‘the flash message’);

How I can render this in the Neos Standard Flash Message Container on top?

Thank you!

Hi Patrick

You need to provide more information in order to be able to help you.

You’re describe it a “plugin”, do you mean a Neos plugin? And so then in what scenario would you like you plugin to display a notification? When rendered on a page viewed in the Neos backend?

Or are you actually talking about a module controller? If so it checks for a container and copies the messages from there and displays as notifications. Looks at the source code of some of the core modules to get an idea. Also in Notifications.js you can find the code responsible on line 52.

Hi,

yes I develop a Neos plugin. In my controllers I use this line ($this->addFlashMessage(‘the flash message’):wink: for creating flashmessages in my fluid template (<f:flashMessages class=“flashmessages” />).

Now I would have flashmessages like the “exceptions” in Neos (red and green).

You know what I mean?

Still not clear, you haven’t mentioned where the flash message is rendered exactly…

The flash message rendered in my fluid template, but it should be rendered in the neos backend (with the neos flashmessage style on top of the backend).

If it’s a plugin rendered on in backend, then you must mean a plugin rendered on a page viewed in the backend, which is what I was trying to get to. Anyway haven’t tried it, but you can try following the answer I already gave with the dom element. Otherwise, if you’re using Neos 2.0 then the notification class is exposed in the external API available on the global variable Typo3Neos.Notification.

Okay thank you. I will try this.