5
<referenceContainer name="header-wrapper">
     <block class="VES\Sociallogin\Block\Buttons" ifconfig="section/group/field/type_multiselect" value="something" as="block.buttons.header" template="Vendor_MOdule::template.phtml" after="-" >
        </block>
</referenceContainer>

Can i do check ifconfig value that saved in system config?

1
  • I don't think so. ifconfig is only for value 0 and 1 (i.e yes /no) Feb 1, 2016 at 11:03

1 Answer 1

8

Yes you can but you cannot check a specific value using layout. So for example, you can do the following that checks to make sure the contacts page is enabled;

<block class="Magento\Framework\View\Element\Html\Link\Current" ifconfig="contact/contact/enabled" name="contact-us-link"/>

Basically the ifconfig checks for an equivalent of true or false. If you want to check a specific value then you would need to use an observer Magento 2: Remove block depending on a config setting

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.