Enabling the CMS content widgets button in the WYSIWYG Editor

Edit on GitHub

The article describes how to enable the CMS content widgets button in the WYSIWYG editor on the Edit Placeholders page.

The content widget drop-down button is used to add CMS content widgets to a block or a page. However, starting with the 201907.0 version, the content widget drop-down button has been disabled in the WYSIWYG editor.

If you want to enable this button on a project level, do the following:

  1. Create the src/Pyz/Zed/CmsContentWidget/CmsContentWidgetConfig.php file.
  2. Insert the following code in that file:
<?php
namespace Pyz\Zed\CmsContentWidget;

use Spryker\Zed\CmsContentWidget\CmsContentWidgetConfig as SprykerCmsContentConfig;

class CmsContentWidgetConfig extends SprykerCmsContentConfig
{
	        /**
	        * @return bool
	        */
	        public function isEditorButtonEnabled(): bool
	        {
		                    return true;
	        }
    }

After the updates have been saved, the content widget drop-down button will be enabled and displayed next to the Content Item drop-down button in the WYSIWYG editor:

Both menus in the WYSIWYG editor