Skip to content

Media url returns nothing in Magento 2

Hi I have a problem with passing an image to a view via WYSIWYG editor. I add the image in the editor, it displays correctly in the editor. Its structure is <img src="{{media url='wysiwyg/technologies/file.png'}}". />, which is, as you can see, the correct notation. After saving the product, the image does not display on the page, and checking devtools I see that I have exactly that string there, i.e. <img src="{{media url='wysiwyg/technologies/file.png'}}" />, while the correct path should be substituted into src there.

Now I’m wondering this because I have a .phtml file that contains so much (it gets this information from this editor), and I’m thinking maybe it’s taking literally what’s typed there, instead of converting it to the correct path?

<?php

$product = $block->getProduct();
echo $product->getData('technologies');

?>

Anyone encountered something like this?