ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 18 - AD0-E720 discussion

Report
Export

An Adobe Commerce developer has created a system configuration field:

Using Layout XML, how can the visibility of a block be controlled by a system configuration?

A.
<block name='block.name' template='Vendor_Module::template.phtml='' ifconfig='vendor/general/enable' />
Answers
A.
<block name='block.name' template='Vendor_Module::template.phtml='' ifconfig='vendor/general/enable' />
B.
<block name='block.name' template=''Vendor_Module: :template.phtml''ifconfig='module/general/enable' />
Answers
B.
<block name='block.name' template=''Vendor_Module: :template.phtml''ifconfig='module/general/enable' />
C.
<block name='block.name' template='Vendor_Module::template.phtml' ifconfig='general/module/enable' />
Answers
C.
<block name='block.name' template='Vendor_Module::template.phtml' ifconfig='general/module/enable' />
Suggested answer: A

Explanation:

To control the visibility of a block using a system configuration, the developer should use the ifconfig attribute in the <block> tag. The ifconfig attribute should specify the path to the system configuration field that determines whether the block is visible or not. For example:

<block name=''block.name'' template=''Vendor_Module::template.phtml'' ifconfig=''vendor/general/enable'' />

This will render the block only if the vendor/general/enable system configuration field is set to true. The module/general/enable and general/module/enable paths are not valid and will not work, as they do not match the system configuration field defined in the image.

Reference: [Layout instructions], [System configuration]

asked 02/10/2024
Kevin Taylor
30 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first