I want to add a login form to CMs page in Magento, I have tried adding this:
{{block type=”core/template” template=”customer/form/login.phtml”}}
in the content section of the CMS page, but its not working . Please help me.
This code finally wordked for me .
{{block type ="Mage_Customer_Block_Form_login" template="customer/form/login.phtml" }}
Open cms.xml in your theme and find the following
<reference name="content">
<block type=”cms/page” name=”cms_page”/>
</reference>
Replace it with this
<reference name="content">
<block type="customer/form_login" name="customer_form_login" template="customer/form/login.phtml"/>
<block type=”cms/page” name="cms_page"/>
</reference>
Then your code should work.
If your magento version less than 1.6 use the below code.
{{block type="customer/login" template="customer/form/login.phtml"}}
if your Magento version is 1.6 or greater
{{block type="customer/login" template="persistent/customer/form/login.phtml"}}
Try this:
{{block type="customer/form_login" name="customer_form_login_block" template="persistent/customer/form/login.phtml"}}
This is a way to do it without modifying any files:
Go into the Design tab
In "Custom Layout Update XML" add the following:
< reference name="content">
< block type="customer/form_login" name="customer_form_login" template="customer/form/login.phtml" after="-"/>
< /reference>
There you go. You can also do this in Categories.
Tested in Magento 1.8.1 (should work on most versions)
Related
This question is somehow related to my previous question. I want the "recently viewed" section to show the products which are recently viewed by my (as a visitor). So in that way, every visitor will see their recently viewed products in that section.
Does magento provide any default functionality for this feature or do I have to do it the way I referred in my previous question.
Yes magento has its default functionality
Goto app/design/frontend/default/(yourtheme)/tempalte/reports folder
If you cant see that folder in your theme, just copy it and save it to your theme folder
you can use the below code to display in layout files
<block type="reports/product_viewed" name="left.reports.product.viewed" template="reports/product_viewed.phtml" />
To call in CMS pages (homepage)
{{block type="reports/product_viewed" name="left.reports.product.viewed" template="reports/product_viewed.phtml"}}
To call in phtml file
<?php echo $this->getLayout()->createBlock('reports/product_viewed')->setTemplate('reports/product_viewed.phtml')->tohtml(); ?>
yes , you can by simply use this
<cms_index_index>
<reference name="content">
<block type="reports/product_viewed" name="home.reports.product.viewed" alias="product_viewed" template="reports/home_product_viewed.phtml" after="product_new">
<action method="addPriceBlockType">
<type>bundle</type>
<block>bundle/catalog_product_price</block>
<template>bundle/catalog/product/price.phtml</template>
</action>
</block>
</reference>
</cms_index_index>
we use a custom template and try to add rwd template for mobile use.
We add an exception for the mobile devices but need now to use an different "home" cms for the rwd template.
Where can I define the cms which is used for the homepage?
I have tried to change the cms.xml
<reference name="content">
<block type="core/template" name="default_home_page" template="cms/default/homeown.phtml"/>
</reference>
and created the cms page homeown
please add your code under <cms_index_index> tag
<cms_index_index>
<reference name="content">
<block type="core/template" name="default_home_page" template="cms/default/homeown.phtml"/>
</reference>
</cms_index_index>
I am using this extension on Magento
http://www.magentocommerce.com/magento-connect/nblog-blog-extension-by-neotheme.html
My blog page is working fine but i want show the recent 3 posts on my footer.
i am not getting any solution for it.
If any one Know this please help me
Check your app\design\frontend\base\default\layout\neotheme\blog.xml.
Add this code in the <default> tag
<reference name="footer">
<block type="neotheme_blog/widget_post_list" name="blog.latest.posts"/>
</reference>
use the following code in default tag of blog.xml
<block type="neotheme_blog/widget_post_list" after="blog.category.list" name="blog.latest.posts">
<action method="setPostCount"><param>5</param></action>
</block>
where between param tag you can enter any digit. the blog will show the no. of posts accordingly.
I would like to add a CMS static block (basket_shipping_message) just above the available shipping methods in my Magento checkout. I can edit the phtml file but would rather do it via my local.xml file.
The following code doesen't seem to be working, any ideas?
<checkout_onepage_index>
<reference name="content">
<reference name="shipping_method">
<block type="cms/block" name="basket_shipping_message" before="available">
<action method="setBlockId"><block_id>basket_shipping_message</block_id></action>
</block>
</reference>
</reference>
</checkout_onepage_index>
Did you call in your phtml template getChildHtml('basket_shipping_message');? That should do it. Without that magento does not render the block
It is a totally easy problem, but Im not able to solve it.
I tried the following:
add layout xml to the update layout field in the backend for this cms page:
<reference name="right">
<block type="reports/product_viewed" before="right.permanent.callout" name="right.reports.product.viewed" template="reports/product_viewed.phtml" />
</reference>
or the same in the local.xml
<cms_index_index>
<reference name="right">
<block type="reports/product_viewed" before="right.permanent.callout" name="right.reports.product.viewed" template="reports/product_viewed.phtml" />
</reference>
</cms_index_index>
Thanks a lot, I know its not complicated, but I cant get it.
Here is some checks:
Check if your page is using two-column-right or three-column layout.
Clearing cache
Add your layout update to cms.xml directly and clearing cache.
Hope this help
You might have missed to echo the block in the custom home page template file?
echo $this->getChildHtml('right.reports.product.viewed');
Or may be your home page is using 2-template left or other templates where there is no 'right' content block.