Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/templates/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/magento/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Templates Magento新页面模板_Templates_Magento - Fatal编程技术网

Templates Magento新页面模板

Templates Magento新页面模板,templates,magento,Templates,Magento,我正在尝试添加一个新模板,这样我就可以有两个并排的内容块。例:内容左和内容右。问题是新字段是空的,我无法在其中显示任何内容。目标是让登录和帐户创建并排进行,每个都在自己的块中 以下是新模板2columns.phtml(修剪了一些): > 下面是我尝试使用的XML: <customer_account_login translate="label"> <label>Customer Account Login Form</label>

我正在尝试添加一个新模板,这样我就可以有两个并排的内容块。例:内容左和内容右。问题是新字段是空的,我无法在其中显示任何内容。目标是让登录和帐户创建并排进行,每个都在自己的块中

以下是新模板2columns.phtml(修剪了一些):


>
下面是我尝试使用的XML:

<customer_account_login translate="label">
        <label>Customer Account Login Form</label>
        <!-- Mage_Customer -->
        <remove name="right"/>
        <remove name="left"/>

        <reference name="root">
            <action method="setTemplate"><template>page/2columns.phtml</template></action>
       </reference>
        <reference name="content_left">
            <block type="customer/form_register" name="customer_form_register" template="customer/form/register.phtml">
                <block type="page/html_wrapper" name="customer.form.register.fields.before" as="form_fields_before" translate="label">
                    <label>Form Fields Before</label>
                </block>
            </block>
       </reference>
        <reference name="content_right">
            <block type="customer/form_login" name="customer_form_login" template="customer/form/login.phtml" />
        </reference>
    </customer_account_login>

客户帐户登入表格
第/2页columns.phtml
之前的表单字段

除了内容左和内容右之外,一切似乎都正常。不幸的是,它需要展示一切重要的东西。我试图更新CSS,并在一个模块中定义了它。使用“content\u left/right”而不仅仅是“content”和其他已经使用的东西是否有问题?请帮助,我已经在这个页面上呆了一整天。

您出现这个问题的原因是您需要添加一个“块”“而不是“引用”

这将附加到每个模板,为其提供执行其工作所需的功能

参考

这是一种将块(或其他规则)附加到特定页面的方法(例如,将特殊块添加到产品视图页面)

要解决此问题,请更换此行:

<reference name="content_left">

与:


如果在另一方面,您的目的是将“输入”列中的所有内容都输入到一列中-(即,您希望在“输入”到一列之前输出“customer\u form\u register”和“customer.form.register.fields.”,在“输入”到另一列之前输出“customer\u form\u login”)

然后执行以下操作:

1) 删除您添加的2个“引用>”

2) 在phtml文件中创建一个div(用于所需的每个部分)


3) 回显这些div中的块名称(即客户表单登录),并添加必要的CSS规则。

出现此问题的原因是您需要添加“块”“而不是”引用

这将附加到每个模板,为其提供执行其工作所需的功能

参考

这是一种将块(或其他规则)附加到特定页面的方法(例如,将特殊块添加到产品视图页面)

要解决此问题,请更换此行:

<reference name="content_left">

与:


如果在另一方面,您的目的是将“输入”列中的所有内容都输入到一列中-(即,您希望在“输入”到一列之前输出“customer\u form\u register”和“customer.form.register.fields.”,在“输入”到另一列之前输出“customer\u form\u login”)

然后执行以下操作:

1) 删除您添加的2个“引用>”

2) 在phtml文件中创建一个div(用于所需的每个部分)


3) 呼应这些div中的块名称(即客户表单登录),并添加必要的CSS规则。

您需要做以下几件事:

  • 创建左内容块和右内容块,而不是引用它们。它们实际上不存在于布局文件中的任何位置,这就是为什么引用它们不起作用的原因。这需要在向其添加其他块之前完成
  • 确保在正确的位置创建了左和右内容块。通过简单地更改对块的引用,您将在与根块相同的级别创建它们……如果将它们放置在此处,它们将不会渲染。因此需要将它们添加到根块中
  • 这就是我能够使用的布局:

    <customer_account_login translate="label">
        <label>Customer Account Login Form</label>
        <!-- Mage_Customer -->
        <remove name="right"/>
        <remove name="left"/>
    
        <reference name="root">
            <action method="setTemplate"><template>page/2column-contact.phtml</template></action>
    
            <block type="core/text_list" name="content_left" as="content_left" translate="label">
                <block type="customer/form_register" name="customer_form_register" template="customer/form/register.phtml">
                    <block type="page/html_wrapper" name="customer.form.register.fields.before" as="form_fields_before" translate="label">
                        <label>Form Fields Before</label>
                    </block>
                </block>
            </block>
    
            <block type="core/text_list" name="content_right" as="content_right" translate="label">
                <block type="customer/form_login" name="customer_form_login" template="customer/form/login.phtml" />
            </block>
        </reference>
    </customer_account_login>
    
    
    客户帐户登入表格
    第/2页Column-contact.phtml
    之前的表单字段
    
    您需要做几件事:

  • 创建左内容块和右内容块,而不是引用它们。它们实际上不存在于布局文件中的任何位置,这就是为什么引用它们不起作用的原因。这需要在向其添加其他块之前完成
  • 确保在正确的位置创建了左和右内容块。通过简单地更改对块的引用,您将在与根块相同的级别创建它们……如果将它们放置在此处,它们将不会渲染。因此需要将它们添加到根块中
  • 这就是我能够使用的布局:

    <customer_account_login translate="label">
        <label>Customer Account Login Form</label>
        <!-- Mage_Customer -->
        <remove name="right"/>
        <remove name="left"/>
    
        <reference name="root">
            <action method="setTemplate"><template>page/2column-contact.phtml</template></action>
    
            <block type="core/text_list" name="content_left" as="content_left" translate="label">
                <block type="customer/form_register" name="customer_form_register" template="customer/form/register.phtml">
                    <block type="page/html_wrapper" name="customer.form.register.fields.before" as="form_fields_before" translate="label">
                        <label>Form Fields Before</label>
                    </block>
                </block>
            </block>
    
            <block type="core/text_list" name="content_right" as="content_right" translate="label">
                <block type="customer/form_login" name="customer_form_login" template="customer/form/login.phtml" />
            </block>
        </reference>
    </customer_account_login>
    
    
    客户帐户登入表格
    第/2页Column-contact.phtml
    之前的表单字段