Magento 2.3.0 – WYSIWYG Editor’s Image Not Loading on Frontend

imagemagento2.3.0urlwysiwyg

we have created some category's custom attribute of WYSIWYG editor type. While we are adding image in these custom attribute's editor, they are showing/loading fine in admin section but while we are fetching these attributes data on frontend, images are not loading.

Magento making image url on frontend like – <img src="{{media url=&quot;handmade-thumb.jpg&quot;}}" alt="" />

Its picking image url as text.

Please help me to solve this issue.

Best Answer

You need to filter that content using cms page filter.

Try following way:


public function __construct(
    \Magento\Cms\Model\Template\FilterProvider $filterProvider
) {
    $this->_filterProvider = $filterProvider;
}

Now use:


$this->_filterProvider->getPageFilter()->filter($content);
Related Topic