Can I add images through a free text field?

Hello, I need to add an additional image for product category, the only way to add additional data seems to be a free text fields. There is no media selection field so I have used a text field and copied path there from a category media field. The problem now is that I have got a virtual path but I need to get an actual path, but there seems no way to call a media service in template to get image url. Is there any alternative method?

What shopware version you use?

You can check this or this plugins as example.

>I need to add an additional image for product category, the only way to add additional data seems to be a free text fields

It isn’t true. You can create your custom model and bind this model with Media and Category, then preDispatch category and fetch this custom model.

If you can’t use attribute as described in plugins above - more fast to use this way. You can check this guide how to create custom backend ext.js app.

Also you can add additional attribute and create custom handler which should save media object, but it takes more time and I haven’t seen any guide, so you should find how to do it by yourself.

1 „Gefällt mir“

Thanks, OssMediaAttributeDispatch is almost exactly what I’ve needed, after some tweaks it is working perfectly.

Nice, I’m glad that it was useful to someone :slight_smile: