New added product preview image (in 720) is not shown in product details page.
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Re: New added product preview image (in 720) is not shown in product details page.
Did you enable/change the ASSET_URL in your .env file?
https://github.com/aimeos/aimeos/blob/m ... example#L7
If yes, try to remove that setting as it's only useful for remote cloud storages
https://github.com/aimeos/aimeos/blob/m ... example#L7
If yes, try to remove that setting as it's only useful for remote cloud storages
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos,
give us a star
If you like Aimeos,
![Image](https://aimeos.org/fileadmin/aimeos.org/icons/star.png)
Re: New added product preview image (in 720) is not shown in product details page.
No. I did not edit it. Today I was trying to use it but I get only loosing all styles and media on the site.Did you enable/change the ASSET_URL in your .env file?
https://github.com/aimeos/aimeos/blob/m ... example#L7
Is there any file system configuration (I mean config/filesystem.php or somewhere else) to redirect storing media files on adding new products?
Re: New added product preview image (in 720) is not shown in product details page.
The base URL for images is defined here:
https://github.com/aimeos/aimeos/blob/m ... p.php#L137
In the templates, the real URLs are created by calling the "$this->content()" view helper, e.g.:
See: https://github.com/aimeos/ai-client-htm ... hp#L51-L54
The filesystem column in the mshop_media table must contain "fs-media" for images.
For responsive images with srcset, the "$this->image()" view helper takes care about creating the real URLs:
- https://github.com/aimeos/ai-client-htm ... ge.php#L27
- https://github.com/aimeos/ai-client-htm ... rd.php#L55
https://github.com/aimeos/aimeos/blob/m ... p.php#L137
In the templates, the real URLs are created by calling the "$this->content()" view helper, e.g.:
Code: Select all
<img src="<?= $enc->attr( $this->content( $mediaItem->getPreview(), $mediaItem->getFileSystem() ) ) ?>">
The filesystem column in the mshop_media table must contain "fs-media" for images.
For responsive images with srcset, the "$this->image()" view helper takes care about creating the real URLs:
- https://github.com/aimeos/ai-client-htm ... ge.php#L27
- https://github.com/aimeos/ai-client-htm ... rd.php#L55
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos,
give us a star
If you like Aimeos,
![Image](https://aimeos.org/fileadmin/aimeos.org/icons/star.png)
Re: New added product preview image (in 720) is not shown in product details page.
Yes. The solution accepted by us is changing default directory for media files in config/shop.php in 'fs-media'.
Thanks a lot!
Thanks a lot!
Re: New added product preview image (in 720) is not shown in product details page.
But I forgot one thing. How to add the following configuration as external
to avoid edit configuration in the aimeos-core/config/controller.php?
Code: Select all
'common' => [
'media' => [
'product' => [
'previews' => [
[
'maxwidth' => 720,
'maxheight' => 960,
'force-size' => 1,
],
],
]
],
],
Re: New added product preview image (in 720) is not shown in product details page.
Add that configuration to your ./config/shop.php
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos,
give us a star
If you like Aimeos,
![Image](https://aimeos.org/fileadmin/aimeos.org/icons/star.png)
Re: New added product preview image (in 720) is not shown in product details page.
I asked this question about configuration because I was trying to use this approach before, and had no result. I know, that this is normal practice to use config/shop.php file to add our own configurations. But it doesn't work for me. I spent almost two days in searching a way to merge this configuration.
So, I tried many ways, like using merging in shop.php, app.php, Service Provider, Extension Service Provider. And now I'm trying Decorator but still in process.
It looks like configuration aimeos-core/config/controller.php loads after all cached configurations at runtime. The key method that need this config is createPreviews() in src/Controller/Common/Media/Standard.php (of 2023.10-th version). And I need to make this method to use modified configuration externally.
What I'm doing wrong?
So, I tried many ways, like using merging in shop.php, app.php, Service Provider, Extension Service Provider. And now I'm trying Decorator but still in process.
It looks like configuration aimeos-core/config/controller.php loads after all cached configurations at runtime. The key method that need this config is createPreviews() in src/Controller/Common/Media/Standard.php (of 2023.10-th version). And I need to make this method to use modified configuration externally.
What I'm doing wrong?
Re: New added product preview image (in 720) is not shown in product details page.
Please show your merged ./config/shop.php (without the credentials).
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos,
give us a star
If you like Aimeos,
![Image](https://aimeos.org/fileadmin/aimeos.org/icons/star.png)
Re: New added product preview image (in 720) is not shown in product details page.
Sure. Here is in the attachments.
- Attachments
-
- config.shop.tar.gz
- (2.46 KiB) Downloaded 149 times
Re: New added product preview image (in 720) is not shown in product details page.
You've missed the 'controller' key where it must be merged below and guess this won't work too:
Code: Select all
'previews' => array_merge(config('controller.common.media.product.previews', []), [
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos,
give us a star
If you like Aimeos,
![Image](https://aimeos.org/fileadmin/aimeos.org/icons/star.png)