The media manager is the central module for managing images, videos and other media in Shopware. The module includes a convenient uploader, that allows for a simple upload process utilizing drag&drop.
The module contains four sections. At the top you'll find the actionbar offering the following actions:
On the left side of the window (7) you'll find a list of all your albums and subalbums. You can create and delete your own albums here, except for the main albums which are not deletable. In the middle section (8) all media found in the active folder/album is displayed. Above that there is the drag&drop-area. If your browser supports drag&drop you can upload files by dragging them onto the d&d-zone. If the file format supports thumbnails, you will see a small preview-thumbnail of your files. In the more information (9)-section you can find additional information regarding your selected files, for example: Download link, name, upload date, type, resolution and the file's URL. Try to avoid static links towards your media. Linking statically is not recommended, instead you should link the file dynamically by using the Shopware MediaService.
You can add media to your album in two different ways. The easiest way is to select the album you want to upload the media to and click Add file to upload your files. The files will be assigned directly to the selected album and if possible even thumbnails will be created.
Alternatively you can move already uploaded files to other albums. Simply drag&drop the media onto your desired album. When you upload new files, the media manager will try and generate preview-thumbnails. Please note that thumbnails can only be created for image-files, other file types won't get thumbnails. You can edit the thumbnail specifications in the album settings by right clicking on the respective album and selecting "settings".
Please note that individually created thumbnail sizes in the main album are not automatically transferred to the subalbums. In case you have set new size values, you will have to create them in every single subalbum in order to keep a consistent look. Only when creating new subalbums those will inherit the thumbnail settings from the main album.
You can always delete files via the media manager by marking these files (tick the checkbox on the left of each row) and click on delete marked files. The files and their thumbnails will be deleted from the server, but note that the assignment to the deleted file or other static links will NOT be deleted, you have to delete these assignments manually!
As of Shopware 5.3 it is possible to replace existing media files directly via the media manager. You can even swap out different file formats and types. E.g. you can replace .jpg with .png-files. In this case only the filename extension is changed, the image name will remain the same.
To replace an existing image, select the image(s) and click on the Replace media button. In the following window, you can choose a new image to replace the old one. This way, it is also possible to replace multiple images at the same time.
Browsercaching may cause old images to still appear to be there after replacing them. These cached files can not be accessed or replaced by Shopware. It may thus be necessary to empty the browser's cache via the settings tab.
You can simply create a new album by clicking the right mouse button in a free area of you album overview and choosing create new album. If you have already selected an album the new one will be created as a subalbum to the latter one (1).
Alternatively you also can click Add album (2) on the left side of the footer to create a new album. According to which album was chosen before, a new main album or a subalbum will be created. Subalbums also inherit the thumbnail settings. Main albums will come without any thumbail settings and will have to be configured manually.
To delete an album, right click on the particular album and select delete album (1). Alternatively you can delete your album by selecting it and clicking delete album (2) on the left of the footer.
Media located in a deleted album will NOT be deleted alongside the album, as you might expect! If you delete an album, the contained media will be moved to the folder "Unsortiert".
To get into the settings, just rightclick the desired album and click Album settings (1)' or simply press the gear (2)-icon to open the following window:
If you made changes to your thumbnail settings, e.g. created new sizes, this has no effect on already uploaded files in the album. If you made any changes, you will have to generate the albums' thumbnails once more. With respect to the quantity, quality and resolution of your media, that process may take some time!
Default thumbnail sizes for the items are:
The Responsive theme needs new thumbnail sizes which are the following:
|Shopping worlds||800x800 1280x1280 1920x1920|
|Banner||800x800 1280x1280 1920x1920|
|Item||200x200 600x600 1280x1280|
|Blog||200x200 600x600 1280x1280|
A conventional office display has a pixel density of around 72 ppi (pixel per inch). Some mobile devices have a pixel density of 500 ppi and more. This may cause images to appear relatively small, because of the relatively high resolution on a relatively small screen. To solve this problem, Shopware generates high resolution thumbnails with a double resolution method. With these thumbnails all images can be displayed correctly on high ppi devices without becoming blurry. Please note that Shopware never upscales images, so take care of uploading images with a resolution of at least the biggest high resolution thumbnail in the shop. If you upload an image the size of e.g. 500x500px it won't ever get bigger than 500x500px.
In the image above the high resolution thumbnails will be generated with max. 400x400px, 1200x1200px and 2560x2560px thereby considering and keeping the image ratio. Shopware always uses the longest side of a picture and scales it to the desired size.
Files will not be stored in only one folder anymore. A hash derived from the respective filename will be used to generate a folder name, in which the file then will be saved. For example /media/image/1d/4a/8c/myImage.jpg. After updating, Shopware automatically migrates the files into the new structure by opening the images in the frontend. Alternatively you also can migrate the files via a shell command. The particular command and code can be found in the "shell tools" area below.
The media manager is equipped with a recycle bin, which automatically collects unused images from the "item"-album. To use this feature, activate the "Media Garbage Collector"-Cronjob, that collects all unused images and discards them by moving them to the recycle bin. You can clear the recycle bin manually in the media manager by rightclicking the recycle bin and select empty recycle bin or simply click the red clear icon.
As of Shopware 5.2.4 the Media Manager supports the following 3D Models:
Please note that this is not yet final. You can upload models and manage files in the Media Manager now. But there is no way of displaying those models in the frontend yet.
The following section describes shell commands which are working on the server's shell. Every action you set off will be processed without hesitation and any check back. Commands will be execute by hitting ENTER. You should only use these tools, if you are confident with what you are doing and always remember to keep your backups up to date!
Many actions performed in the media manager can also be executed in the shell. We assume, that you have a shell connection and you're located in the Shopware root folder. There you can use the following shell commands:
You can also execute options with most commands. Use " -h" to open the help-file. Here you can find a list of available commands and options.
The config.php allows you to define which file types can be uploaded via the Media Manager.
Please note that some basic media files can generally be uploaded, e.g. jpg, png and pdf.
In addition, for security reasons, uploading executable files such as php, com and exe is generally prohibited, even if the file extensions are entered in the whitelist.
In the following example code for the config.php you can upload docx and xlsx files:
'media' => [ 'whitelist' => [ 'docx', 'xslx' ], ]
The file extensions are not case-sensitive.
Using this tool you can optimize your media directly in Shopware to save disk size and traffic to optimize the load of your page, which also optimizes your google pagespeed rank.
Keep in mind:The optimisation of your media files is made lossless, your files will not be compressed. The optimisation only strips meta data and for displaying unnecessary data to shrink the filesize! To compress the files, you should still use the shopware internal compression.
Apparent from our tests, another compression by these tools won't shrink your files again, so it's enough to compress them by using the Shopware settings and just let the tools optimize the files lossless.
While uploading new files using the media manager, the optimizer automatically generates optimized thumbnails of your media. The original will remain unaffected.
This way we make sure, that you are able to generate new thumbnails from your media using the real original.
When you've e.g. updated Shopware and you already have your system running, you can regenerate all your thumbnails. At regenerating all thumbnails, those files will also processed by the optimizer, the original will remain unaffected here as well!
To optimize your media manually, you need to open an ssh session, navigate in the Shopware root directory and execute the following command to start optimizing:
bin/console sw:media:optimize [parameter] [path]
Shopware now scans your file system for media and optimize them.
Keep in mind: This command will check the whole Shopware installation for media files and optimizes them by default. If you have other non-Shopware media files, this command will optimize them too! So if you want to optimize only your Shopware media files, make sure to add the path to your command to optimize just the files in this desired directory.
Here we have a few examples:
// Help bin/console sw:media:optimize -h // Info about the optimization tools bin/console sw:media:optimize -i // Optimize media files just in this folder bin/console sw:media:optimize /var/www/media // Limit the files to gather by date/time bin/console sw:media:optimize -m // Verbose bin/console sw:media:optimize -v
Shopware can use the following tools by default:
If at least one of these tools is installed, the supported MIME-types will be optimized over this tool. If more tools are installed, an internal logic will ensure, that only the better tools is used for optimizing your media files. If no tool is installed, the process will finish without any optimization.
Please ask your hoster about these tools and let him install at least one per used MIME-type, we suggest jpegtran & optipng.
The media optimizer can be extended using plugins to include more tools or setup the existing tools more individual. If you need such an extension, please take a look at our developer documentation for the media optimizer.