How to filter Static Block content in template file using magento 2?

Sometimes we have defined a native static variable in Static Block in Magento 2 and we need to call that block in template file at that time static variable will not be interpreted,
Like Custom variable {{config path=”web/unsecure/base_url”}} in static block. using below method content will be displayed the dynamic value of static block variables.
We need to use, \Magento\Cms\Model\Template\FilterProvider class to filter static content in Blocks.

Call from the template file,

The result will be displayed filterable static variable value with your content.

Leave a Reply

Your email address will not be published. Required fields are marked *