我想添加一个新的模板,所以我可以并排两个内容块。例如:content_left和content_right。问题是新的领域是空的,我无法得到任何东西出现在他们身上。目标是并排登录和创建帐户,每个帐户都有自己的块。Magento新页面模板
这里是新模板2columns.phtml(削减部分):
<?php echo $this->getChildHtml('head') ?>
</head>
<body<?php echo $this->getBodyClass()?' class="'.$this->getBodyClass().'"':'' ?>>
<?php echo $this->getChildHtml('after_body_start') ?>
<div class="wrapper">
<?php echo $this->getChildHtml('global_notices') ?>
<div class="page">
<?php echo $this->getChildHtml('header') ?>
<div class="main-container col2-right-layout">
<div class="main">
<?php echo $this->getChildHtml('breadcrumbs') ?>
<div class="col-main1">
<?php echo $this->getChildHtml('global_messages') ?>
<?php echo $this->getChildHtml('content_left') ?>
</div>
<div class="col-main2"><?php echo $this->getChildHtml('content_right') ?></div>
</div>
</div>
<?php echo $this->getChildHtml('footer') ?>
<?php echo $this->getChildHtml('before_body_end') ?>
</div>
</div>
<?php echo $this->getAbsoluteFooter() ?>
这里是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>
一切似乎除了content_left工作, content_right。不幸的是,这需要显示一切重要。我试着更新CSS,并在模块中定义它。问题是使用'content_left/right'而不是'content'和其他已经使用的东西?请帮忙,我一整天都在这个页面。
谢谢!这工作得很好。这是非常好的知道。 –