Magento 2.1.7 form.additional.info不会在客户登录页面中呈现块

时间:2018-03-10 14:59:38

标签: magento magento2

客户登录未在登录页面上显示验证码。 所以我在模块中创建了自定义块并将其添加到form.additional.info 仍然没有显示输出。

如果我在'content'容器上添加新创建的块,它会显示输出

以下是一些代码。

这是我的customer_account_login.xml

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
            <referenceContainer name="form.additional.info">

            <block class="Siddhesh\Customization\Block\SampleBlock" name="custom_element1" template="Siddhesh_Customization::test1.phtml" cacheable='false' />

        </referenceContainer>
    </body>
</page>

login.phtml包含

<?php echo $block->getChildHtml('form_additional_info'); ?>

test1.phtml包含

new content added

这是来自主题

的customer_account_login.xml
<?xml version="1.0"?>
<!--
/**
 * Copyright © 2017 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="page.main.title">
            <action method="setPageTitle">
                <argument translate="true" name="title" xsi:type="string">Customer Login</argument>
            </action>
        </referenceBlock>
        <referenceContainer name="content">
            <!-- customer.form.login.extra -->
            <container name="customer.login.container" label="Customer Login Container" htmlTag="div" htmlClass="login-container">
            <container htmlTag="div" htmlClass="login-form">
                <block class="Magento\Customer\Block\Form\Login" name="customer_form_login" template="form/login.phtml">
                    <container name="form.additional.info" as="form_additional_info"/>
                </block>
                <block class="Magento\Customer\Block\Form\Login\Info" name="customer.new" template="newcustomer.phtml"/>
                </container>
            </container>
            <block class="Magento\Cookie\Block\RequireCookie" name="require-cookie" template="Magento_Cookie::require_cookie.phtml">
                <arguments>
                    <argument name="triggers" xsi:type="array">
                        <item name="loginButton" xsi:type="string">.action.login</item>
                    </argument>
                </arguments>
            </block>
        </referenceContainer>
        <referenceContainer name="form.additional.info">
            <block class="Magento\Framework\View\Element\Template" name="form_additional_info_customer" template="Magento_Customer::additionalinfocustomer.phtml"/>
        </referenceContainer>
    </body>
</page>

在做了一些实验之后,我发现additionalinfocustomer.phtml正确加载 我无法弄清楚为什么验证码或我的自定义样本块没有渲染 伙计们你有一些线索或我如何进一步调试? 欢迎任何建议

环境: magneto 2.1.7 所有缓存:禁用。

0 个答案:

没有答案