1

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.

2

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);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.