Php 将客户登录表单添加到CMS页面(Magento 1.9)
我找不到这个问题的明确答案,所以如果它对其他人有帮助的话,就值得一写 我在Magento 1.9上运行一个站点。我希望客户帐户登录表单出现在CMS页面内容旁边 这通常可以在页面上找到 www.mydomain.com/customer/account/login/referer/[插入推荐密钥]/ 据我所知,表单的代码位于app/design/frontend/base/default/template/customer/form/login.phtml中,布局的XML是Php 将客户登录表单添加到CMS页面(Magento 1.9),php,magento,magento-1.9,Php,Magento,Magento 1.9,我找不到这个问题的明确答案,所以如果它对其他人有帮助的话,就值得一写 我在Magento 1.9上运行一个站点。我希望客户帐户登录表单出现在CMS页面内容旁边 这通常可以在页面上找到 www.mydomain.com/customer/account/login/referer/[插入推荐密钥]/ 据我所知,表单的代码位于app/design/frontend/base/default/template/customer/form/login.phtml中,布局的XML是 <cus
<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/1column.phtml</template></action>
</reference>
<reference name="content">
<block type="customer/form_login" name="customer_form_login" template="customer/form/login.phtml" />
</reference>
</customer_account_login>
客户帐户登入表格
第/1页column.phtml
我对CSS很熟悉,所以我可能会想出如何设计表单以适应页面,但无法想出如何将内容块整齐地放在页面中
有什么想法吗
谢谢你的阅读 请尝试以下代码:
{{block type ="Mage_Customer_Block_Form_login" template="customer/form/login.phtml" }}
我知道我需要做什么 我从现有的登录表单中创建了一个定制的CMS登录表单-cmslogin.phtml-cribbed 我把这个上传到 应用程序/设计/前端/基础/默认/模板/cms 然后在CMS页面中通过调用表单作为块
{{block type="core/template" template="cms/cmslogin.phtml"}}
这似乎已经完成了工作,但我现在有一个问题,让登录表单正常工作-我认为这与CMS页面的URL不包括默认登录页面的唯一键有关。即
www.mydomain.com/customer/account/login/referer/[插入推荐密钥]/
在此方面的任何帮助都将不胜感激。cmslogin.phtml的代码为:
<div class="block block-login">
<div class="block-title">
<strong><span><?php echo $this->__('Login') ?></span></strong>
</div>
<form action="<?php echo $this->getPostActionUrl() ?>" method="post" id="login-form">
<div class="block-content">
<label for="mini-login"><?php echo $this->__('Email:') ?></label><input type="text" name="login[username]" value="<?php echo $this->escapeHtml($this->getUsername()) ?>" id="email" class="input-text required-entry validate-email" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Email Address')) ?>" />
<label for="mini-password"><?php echo $this->__('Password:') ?></label><input type="password" name="login[password]" class="input-text required-entry validate-password" id="pass" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Password')) ?>" />
<div class="actions">
<button type="submit" class="button" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Login')) ?>" name="send" id="send2"><span><span><?php echo $this->__('Login') ?></span></span></button>
</div>
</div>
</form>
你想要实现什么?您想在cms页面调用登录表单吗?@AhmedGinani是的,如果可能的话。但这样我就可以控制表单的外观和位置。检查答案是否有效?@AhmedGinani不起作用,不。不,不幸的是,这不起作用。我以前遇到过这个解决方案——在内容中放置它的地方没有显示任何内容。作为参考,这是我在代码中放置它的地方,当前用户请在下面登录。{{block type=“Mage\u Customer\u block\u Form\u login”template=“Customer/Form/login.phtml”}