magento2-page-builder icon indicating copy to clipboard operation
magento2-page-builder copied to clipboard

CMS Blocks are identified by `id`, not `identifier`

Open lbajsarowicz opened this issue 5 years ago • 0 comments
trafficstars

Preconditions (*)

  1. Magento 2.3.4

Steps to reproduce (*)

  1. Create CMS page
  2. Add CMS Block using PageBuilder

Expected result (*)

  1. The source should refer to CMS Block by identifier
{{widget type="Magento\Cms\Block\Widget\Block" template="widget/static_block/default.phtml" block_identifier="sample_block" type_name="CMS Static Block"}}

Actual result (*)

  1. CMS block has id hardcoded
{{widget type="Magento\Cms\Block\Widget\Block" template="widget/static_block/default.phtml" block_id="16" type_name="CMS Static Block"}}

Business Case

  1. Merchant has 2 websites
  2. He wants to have similar Home Page with only one different block
  3. He doesn't want to maintain 2 pages each for the website - that is why we inject 1 block, that is declared per-scope

With block declared with ID, you still need to have 2 versions of a page. With CMS Block identified by identifier, GetBlockByIdentifier is going to take care about the scope.

Developer Experience

  1. Installing Block with Data Patch
  2. I want to refer the created block from CMS Page

Without the block reference by identifier - I need to get block by identifier manually and then update the CMS page to refer the block created by Data Patch.

lbajsarowicz avatar May 21 '20 19:05 lbajsarowicz