Media Selection (Browser) in Custom Backend Module

Hello,

I’m looking for a way how to use the “image/media browser” in my custom backend modules!

In NodeTypes Yaml it is just this:

properties: image: type: 'Neos\Media\Domain\Model\ImageInterface'

mediaBrowser

I’ve created a custom Backend Module in Fusion-way, using Fusion-Forms to create, edit and delete a model.

Is there a way that I can use “media browser” in my custom Backend Module to choose an image for my model?

gz Salvatore

Hi Salvatore and welcome to our community! :slight_smile:

Do you want to replace the media module for all of your assets or only for certain node properties?

Maybe you can have a look at the https://github.com/Flowpack/media-ui to find out how @sebobo replaced the module there?

Hi, I think I dont want to replace the media module and I’m not working with nodes where I want to use the media module’s browser.

I’m quite new in the Neos world, so I don’t know all possibilities how to achive what I want or what’s possible :confused:

I created two screenshots, what I currently have and what I want to to have:

I am working in my backend module, not in any Document- or Content-Node…

Hello @seckel,

i can’t answer this question for you for a backend module, but maybe @bwaidelich can help you.

If you want to use the settings in a Neos-Site though, i would suggest you to create a NodeType that inherits from Document that you only use as your Entry page (Home). There you can add all the required settings you need only once / globally on your site. And it’s also much easier to access those settings in the fusion prototypes as you can simply write sth like this:

prototype(Vendor.Prefix:Your.Component) {
    globalSetting = ${q(site).property('globalSetting')}
}

Also you have access to all the already existing editors which are not available for backend modules that easily (as far as i know).

To group this settings, simply use tabs or groups in your node type definitions. See https://neos.readthedocs.io/en/stable/References/NodeTypeDefinition.html?highlight=tabs#nodetype-definition-reference for further information.

Ah, sorry, I completely misinterpreted your question. So you just want to use the Neos Editors (in this case the AssetEditor) wihtin a custom backend module!?

Still, the new media-ui repository might be a good source of inspiration since that uses editors in a new backend module as well.

Okay, it’s a good idea to use the HomePage-document-nodetype to put these global (design)settings like “logo, favicon, fontcolor & fontfamily” into a new tab (to be able to use the Neos Editors)!

Thanks and I will have a look into “flowpack/media-ui”, especially to GraphQL for querying assets, because I think I have to implement it by my own, what I want to achive :slight_smile:

For site settings a dedicated tab on the HomePage node is by far the best and easiest way. I did not get what you were up to from your original question.