[SOLVED] Flashmessages in Neos Backend Modules

Hi,

I’m trying to output flashmessages in a Backend Module for a Domain Model (Member) on update.
Trying to reverse engineer flashmessages of Neos-Users and Images. (The kind, that appears and disappears)

In my Template i have:

<div class="neos-notification-container">
  <f:flashMessages id="neos-notifications-inline" class=""/>
</div>

With this I got the Markup containing my Message.

<div class="neos-notification-container">
  <ul id="neos-notifications-inline">
    <li class="-ok">
      <h3>Info</h3>
      Mitglied Testman gespeichert.
    </li>
  </ul>
</div>

I shuffled everything back and forth but never got the correct CSS and JS.
Here I tried to get rid of a wrong class with:

class=""

Flashmessages for Neos Users and Images have a data-attribute, but no class.
It’s a pain …

So the big question:
What has to be done to apply the correct CSS and JS?

Have a nice evening
Klaus

Hi Klaus :wink:

Just take a look at the existing backend modules. If you use the default BackendModule Layout that already renders the flashmessages using a custom partial

CSS and JS will be applied correctly if it runs in the backend.

Best,
Bastian

Thanks a lot Bastian!

It works, but I had to copy the Layout and the Partial to my package.
I don’t like this copy and paste stuff.
Is it possible to use the templates of my package and the layouts and partials from another package?

Regards
Klaus

P.S.
I will join the meetup next monday in Düsseldorf.

Yes, have a look at the Views.yaml documentation

That’s great!

…To see Views.yaml in action: https://github.com/neos/media-browser/blob/master/Configuration/Views.yaml

Thanks again Bastian!

That is exactly what I wanted. The templates from my package now use the layout and partial from the Neos package.

Here is my Views.yaml (Neos 2.3)

-
  requestFilter: 'parentRequest.isPackage("TYPO3.Neos") && isFormat("html") && isPackage("Eg.Member")'
  options:
    layoutRootPaths:
      'TYPO3.Neos': 'resource://TYPO3.Neos/Private/Layouts'
    partialRootPaths:
      'TYPO3.Neos': 'resource://TYPO3.Neos/Private/Partials'
1 Like