Skip to main content
added 2 characters in body
Source Link
Jey DWork
  • 1.1k
  • 4
  • 13
  • 25

In Magento 2 we can add widgets to CMS pages and CMS blocks with a directive like this (assuming we created this custom widget with a module before):

{{widget type="Vendor\Module\Block\Widget\CustomWidget" some_addtribute="some-value"}} 

When we add the same widget code in product or category description it is not rendered. So the output is the text string from above.

How can we extend Magento 2 in a way that it will render widgets in product or category descriptions as well?

In Magento 2 we can add widgets to CMS pages and CMS blocks with a directive like this (assuming we created this custom widget with a module before):

{{widget type="Vendor\Module\Block\Widget\CustomWidget" some_addtribute="some-value"}} 

When we add the same widget code in product or category description it is not rendered. So the output is the text string from above.

How can we extend Magento 2 in way that it will render widgets in product or category descriptions as well?

In Magento 2 we can add widgets to CMS pages and CMS blocks with a directive like this (assuming we created this custom widget with a module before):

{{widget type="Vendor\Module\Block\Widget\CustomWidget" some_addtribute="some-value"}} 

When we add the same widget code in product or category description it is not rendered. So the output is the text string from above.

How can we extend Magento 2 in a way that it will render widgets in product or category descriptions as well?

Source Link
Jey DWork
  • 1.1k
  • 4
  • 13
  • 25

How to render widgets in product and category description in Magento 2?

In Magento 2 we can add widgets to CMS pages and CMS blocks with a directive like this (assuming we created this custom widget with a module before):

{{widget type="Vendor\Module\Block\Widget\CustomWidget" some_addtribute="some-value"}} 

When we add the same widget code in product or category description it is not rendered. So the output is the text string from above.

How can we extend Magento 2 in way that it will render widgets in product or category descriptions as well?