Layout XML Directive - `if helper` and `ifconfig`

Posted Over 1 year ago. Visible to the public.

The addition of head elements for Vue are dependent on the helper method which returns a bool.

See app\code\core\Mage\Page\Block\Html\Head.php

<layout>
     <default>
        <reference name="head">
            <action method="addItem">
                <type>js</type>
                <name>lib/vue2611dev.js</name>
                <params />
                <if helper="adminpanel/noVue" />
            </action>
            <action method="addItem">
                <type>skin_css</type>
                <name>css/vue.css</name>
                <params />
                <if helper="adminpanel/noVue" />
            </action>
        </reference>
    </default>
</layout>

ifconfig:

    <reference name="head">
        <action method="addJs" ifconfig="customer/captcha/enable"><file>mage/captcha.js</file></action>
    </reference>
kiatng
Last edit
Over 1 year ago
kiatng
Posted by kiatng to OpenMage (2022-08-23 03:07)