I Have problem with calling login form into a page.
I build a .phtml file called members.phtml
& login.phtml
locate on base/default/template/members
members.phtml
<?php if(Mage::getSingleton('customer/session')->isLoggedIn()): ?>
<?php $loadHtml = 'Hi Logged User...welcome'; ?>
<div>
<?php echo $loadHtml; ?>
</div>
<?php else: ?>
<?php $loadHtml = 'Please register or login if already registered.'; ?>
<div>
<?php echo $loadHtml; ?>
</div>
<?php echo this->getLayout()->createBlock('members/login')->setTemplate('members/login.phtml')->toHtml(); // show login form ?>
<?php endif; ?>
login.phtml
I copied from standard customer/account
login folder
Then I create CMS -> Page -> Members
the content of that page is
{{block type="core/template" name="membersState" template="members/members.phtml"}}
The problem is :
The login block doesn't show when guest user accessing the Member Page, does the code that I used is wrong..
Best Answer
welcome to Magento Stack Exchange. Don't worry, English is not at all a problem here as long as we understand what your real question is. :)
Your CMS page content looks good. But your
members.phtml
file has a small problem. Problem resides exactly here :Problems are given below:
You are using
this
. It is wrong. It should be$this
.You are trying to create a block of type
customer/login
which Magento is unaware of. You really need to use a block type which Magento knows. In this particular context, the block type iscustomer/form_login
. So your code will look like this.I believe this will resolve your problem. Good luck