1

I'm new to Mage 2 but familiar with M1. This is a M2.1.1 site

I'm attempting to output a static block in the product description by entering short code in the wysiwsyg editor like so:

{{block class="Magento\\Cms\\Block\\Block" block_id="block_identifier"}}

Even entering it in non-wysiwyg mode results in the same output:

{{block class="Magento\Cms\Block\Block" block_id="block_identifier"}}

is outputted rather than the static block.

However, if I use a widget to render the static block, all is ok.

Am I missing something fundamental - do I need to assign permissions to static blocks like in M1? Or is it possible that the template is at fault?

ps - what happened to the add widget/block buttons on the wysiwyg editor??

4
  • Where are you trying to do this? I mean, where in the admin panel. May 2 '18 at 16:39
  • Hi, thanks for responding. I'm attempting to add the static block in the product description text area on a per product basis.
    – Freshwebs
    May 3 '18 at 18:15
  • Ah ok. So the product description area, in both M1 and M2, do not accept these. This would require an extension or a customization. May 3 '18 at 18:31
  • No, sorry, in M1 you can add short codes in the product description - [code] {{block class="Magento\Cms\Block\Block" block_id="block_identifier"}}[/code] works as expected in M1
    – Freshwebs
    May 5 '18 at 5:35
1

You can use this free extension to add cms block in product description https://github.com/magefan/module-catalog

2
  • Thanks for the link - seems odd the M2 requires an extension to achieve something so fundamental? This has been core in M1 since almost the outset.
    – Freshwebs
    May 3 '18 at 18:23
  • The extension you provided looks like exactly what I was thinking, a simple plugin method to pass the description through the filter. Be aware that the extension linked to in the post also does some sort of modification on the breadcrumbs. May 3 '18 at 18:33

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.