ExamGecko
Question list
Search
Search

Question 42 - AD0-E717 discussion

Report
Export

What is the correct way to inject CMS block in a layout?

A.
<block class='Magento\Cms\Block\Block' name='blockjdentifier'> <arguments> q <argumentname='block_id'xsi:type='string'>my_cms_block_identifier</argument> </arguments> </block>
Answers
A.
<block class='Magento\Cms\Block\Block' name='blockjdentifier'> <arguments> q <argumentname='block_id'xsi:type='string'>my_cms_block_identifier</argument> </arguments> </block>
B.
<block class='Magento\Cms\Block\Block' name='block_identifier'> q <actionmethod='setBlock'>my_cms_block_identifier</action> </block>
Answers
B.
<block class='Magento\Cms\Block\Block' name='block_identifier'> q <actionmethod='setBlock'>my_cms_block_identifier</action> </block>
C.
<referenceBlock name='content'> <block class='Magento\Cms\Block\Block' name='block_identifier' identifier='my_cms_block_ldentrfier' /> </referenceBlock>
Answers
C.
<referenceBlock name='content'> <block class='Magento\Cms\Block\Block' name='block_identifier' identifier='my_cms_block_ldentrfier' /> </referenceBlock>
Suggested answer: C

Explanation:

To inject a CMS block in a layout, you can use the <referenceBlock> tag. The <referenceBlock> tag takes two attributes: the name of the block to inject and the identifier of the block. In this case, the block name is block_identifier and the identifier is my_cms_block_identifier.

asked 02/10/2024
Zaid Mohammed Haqqani
33 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first