When I insert a image in the wysiwyg editor (TinyMCE) the image shows properly in the frontend but gets a broken thumbnail image in the editor.


The url it generates in the editor is similar to this:


Is there a way to show the image properly in the editor?

I'm using magento version 2.1.7


I solved this problem by adding this line:

'add_directives' => true,

in this file


the block should looks like this:

            'enabled' => $this->isEnabled(),
            'hidden' => $this->isHidden(),
            'use_container' => false,
            'add_variables' => true,
            'add_widgets' => true,
            'no_display' => false,
            'encode_directives' => true,
            'baseStaticUrl' => $this->_assetRepo->getStaticViewFileContext()->getBaseUrl(),
            'baseStaticDefaultUrl' => str_replace('index.php/', '', $this->_backendUrl->getBaseUrl())
                . $this->filesystem->getUri(DirectoryList::STATIC_VIEW) . '/',
            'directives_url' => $this->_backendUrl->getUrl('cms/wysiwyg/directive'),
            'popup_css' => $this->_assetRepo->getUrl(
            'content_css' => $this->_assetRepo->getUrl(
            'width' => '100%',
            'height' => '500px',
            'plugins' => [],
            'add_directives' => true,

It is working in Magento 2.1.7

| improve this answer | |

You should check Wysiwyg in backend Stores / Configuration / General / Content Management / Make sure wysiwyg enabled

'add_directives' => true in wysiwyg config


You can see xample in Magento_Cms

| improve this answer | |

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.