-
12-12-2019 - |
题
我对 magento 比较陌生。我想将客户帐户注册页面分为两栏。最好在左侧写上名字、姓氏、电子邮件和密码。右侧,地址字段。
我可以从布局/customer.xml 中找到 RWD 主题的以下代码。
客户账户登记表
<reference name="root">
<action method="setTemplate"><template>page/1column.phtml</template></action>
</reference>
<reference name="content">
<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>
</customer_account_create>
是否可以更改上面的代码并将表单分成两列?
谢谢
解决方案
您无法通过布局 xml 将表单拆分为 2 列。术语“列”在 Magento 中具有不同的含义。列就像其内部元素的容器,您需要将所有字段都放在同一个容器中,因为它们应该包装在表单中。
但你可以做的是编辑模板 customer/form/register.phtml
并更改标记以满足您的需求。将文件复制自 app/design/frontend/base/default/template/customer/form/register.phtml
到你的主题 app/design/frontend/{package}/{theme}/template/customer/form/register.phtml
保持相同的路径并在克隆中发挥你的魔力。