is it possible to call static blocks in the category description of magento 2?

I don´t want to use the "Add CMS Block" DropDown under the description field.

It is necessary to call the blocks in the description field.

I would like to call blocks like sliders: {{revslider alias="fullslider-en"}}

or product lists:

{{block class="Infortis\Base\Block\Product\ProductList\Featured" template="product/list.phtml" category_id="13"}}

Any ideas?

Many thanks in advance Andi

2 Answers 2


Override View.php block


Add class \Zend_Filter_Interface in your block to filter output to html

protected $templateProcess;

public function __construct(
    \Zend_Filter_Interface $templateProcess
) {
    $this->templateProcess = $templateProcess;

public function filterOutputHtml($string) 
    return $this->templateProcess->filter($string);


In your di.xml


<type name="Vendor\Module\Block\Category\View">
        <argument name="templateProcessor" xsi:type="object">Magento\Widget\Model\Template\Filter</argument>

Now call filterOutputHtml() to description.phtml

Override description.phtml to your theme



//Get category description
$_description = $block->getCurrentCategory()->getDescription();

//Convert block {{ }} to html
<?php echo $block->filterOutputHtml($_description);
  • Uncaught Error: Cannot instantiate interface Zend_Filter_Interface Commented Aug 29, 2018 at 7:07
  • @KetanBorada You need to add di.xml. Please check my updated answer Commented Aug 29, 2018 at 8:31
  • i'm still getting same error are you sure this is right? prntscr.com/ko585c Commented Aug 29, 2018 at 8:41
  • can you show by objectmanager? Commented Aug 29, 2018 at 8:55
  • @PrincePatel I am also working same task can you pls help me magento.stackexchange.com/q/330082/57334
    – zus
    Commented Jan 27, 2021 at 13:23

You need to override core functionality to show widget options then you can insert static block using widget interface.

Create/Edit your di.xml and define a preference:

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <preference for='Magento\Catalog\Block\Adminhtml\Helper\Form\Wysiwyg\Content' type='[Vendor]\[Module]\Block\Adminhtml\Helper\Form\Wysiwyg\ContentRewrite'/>

File Magento\Catalog\Block\Adminhtml\Helper\Form\Wysiwyg\Content

protected function _prepareForm()
    /** @var \Magento\Framework\Data\Form $form */
    $form = $this->_formFactory->create(
            'data' => ['id' => 'wysiwyg_edit_form', 'action' => $this->getData('action'), 'method' => 'post'],

    $config['document_base_url'] = $this->getData('store_media_url');
    $config['store_id'] = $this->getData('store_id');
    $config['add_variables'] = false;
    $config['add_widgets'] = true; // change this from false to true
    $config['add_directives'] = true;
    $config['use_container'] = true;
    $config['container_class'] = 'hor-scroll';

            'name' => 'content',
            'style' => 'width:725px;height:460px',
            'required' => true,
            'force_load' => true,
            'config' => $this->_wysiwygConfig->getConfig($config)
    return parent::_prepareForm();

You may also need to override the block and view file for templateProcess.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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