Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMS Blocks are identified by id, not identifier #503

Open
lbajsarowicz opened this issue May 21, 2020 · 0 comments
Open

CMS Blocks are identified by id, not identifier #503

lbajsarowicz opened this issue May 21, 2020 · 0 comments

Comments

@lbajsarowicz
Copy link
Contributor

lbajsarowicz commented May 21, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants