Magento 2 thumbnail main image cache path link changed from this link on the home page after 2 days pub/media/catalog/product/cache/be293bf7411b924394287949fb9084eb/b/e/be-in-in.png
to this
media/catalog/product/cache/be293bf7411b924394287949fb9084eb/b/e/be-in-in.png
because of that, I am getting this
but when do flush Magento cache it changes back to
pub/media/catalog/product/cache/be293bf7411b924394287949fb9084eb/b/e/be-in-in.png
please can anyone give me suggestion to solve this issue?
thanks
1 Answer 1
You need to create a custom module to be able to change the image path
Create that Block class and extend \Magento\Framework\Data\Form\Element\Image
namespace VendorName\ModuleName\Helper\Image;
class Custom extends \Magento\Framework\Data\Form\Element\Image
{
public function _getUrl()
{
$url = 'YourModulePath'.$this->getValue();
return $url;
}
}
-
but i am not getting any issue on beta site this only happens after 2 or 3 days the image path is changed automaticallyDanish Tyagi– Danish Tyagi2021年06月07日 07:38:33 +00:00Commented Jun 7, 2021 at 7:38
-
and this issue is only occur on home page all other page is getting the imageDanish Tyagi– Danish Tyagi2021年06月07日 07:39:10 +00:00Commented Jun 7, 2021 at 7:39
-
The path containing the image is a fixed URL and it will not change unless you intervene and these links. You can check that the extensions you are using and especially the theme you are using are calling the correct image link.LitExtension Magento Migration– LitExtension Magento Migration2021年06月10日 02:21:33 +00:00Commented Jun 10, 2021 at 2:21
-
the issue is images are not visible only on the homepage but visible on all frontend pagesDanish Tyagi– Danish Tyagi2021年06月21日 07:26:49 +00:00Commented Jun 21, 2021 at 7:26
-
Have you deployed and re-run the indexer for your site? If not, please run the commands one by one: php bin/magento setup:static-content:deploy php bin/magento indexer:reindexLitExtension Magento Migration– LitExtension Magento Migration2021年07月01日 06:53:31 +00:00Commented Jul 1, 2021 at 6:53