I am new in magento. I want to make customer login page 3 column layout, which is 1 column by default. I got code from somewhere to make it 3 column layout.
<customer_account_login>
<reference name="root">
<action method="setTemplate">
<template>page/3columns.phtml</template>
</action>
</reference>
</customer_account_login>
But I don't know where I have to write this code to make customer login page 3 column layout.
<customer_account_login translate="label">
<label>Customer Account Login Form</label>
<!-- Mage_Customer -->
<reference name="left">
<block type="catalog/product_compare_sidebar" name="catalog.compare.sidebar" template="catalog/product/compare/sidebar.phtml"/>
</reference>
<reference name="right">
<block type="catalog/product_compare_sidebar" name="catalog.compare.sidebar" template="catalog/product/compare/sidebar.phtml"/>
</reference>
<reference name="root">
<action method="setTemplate"><template>page/3columns.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>
Go to app\design\frontend\rwd\default\layout\customer.xml Open customer.xml file
There you will have code for customer login page like this
<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>
Here in this line <action method="setTemplate"><template>page/1column.phtml</template></action> change page/1column.phtml to page/3columns.phtml
But for that you should have 3columns.phtml file in app\design\frontend\rwd\default\template\page\ here. If you don't have create 3columns.phtml there and put this code in it.
<!DOCTYPE html>
<!--[if lt IE 7 ]> <html lang="<?php echo $this->getLang(); ?>" id="top" class="no-js ie6"> <![endif]-->
<!--[if IE 7 ]> <html lang="<?php echo $this->getLang(); ?>" id="top" class="no-js ie7"> <![endif]-->
<!--[if IE 8 ]> <html lang="<?php echo $this->getLang(); ?>" id="top" class="no-js ie8"> <![endif]-->
<!--[if IE 9 ]> <html lang="<?php echo $this->getLang(); ?>" id="top" class="no-js ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <html lang="<?php echo $this->getLang(); ?>" id="top" class="no-js"> <!--<![endif]-->
<head>
<?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 col3-layout">
<div class="main">
<?php echo $this->getChildHtml('breadcrumbs') ?>
<div class="col-wrapper">
<?php // This left_first block will display above the main content on smaller viewports ?>
<?php if ($_leftContent = $this->getChildHtml('left_first')): ?>
<div class="col-left sidebar col-left-first"><?php echo $_leftContent; ?></div>
<?php endif; ?>
<div class="col-main">
<?php echo $this->getChildHtml('global_messages') ?>
<?php echo $this->getChildHtml('content') ?>
</div>
<div class="col-left sidebar"><?php echo $this->getChildHtml('left') ?></div>
</div>
<div class="col-right sidebar"><?php echo $this->getChildHtml('right') ?></div>
</div>
</div>
<?php echo $this->getChildHtml('footer_before') ?>
<?php echo $this->getChildHtml('footer') ?>
<?php echo $this->getChildHtml('global_cookie_notice') ?>
<?php echo $this->getChildHtml('before_body_end') ?>
</div>
</div>
<?php echo $this->getAbsoluteFooter() ?>
</body>
</html>
And if you are using other theme then please go to your theme folder insted of rwd
Related
would like to ask you some help regarding an issue I'm having in the wishlist section. When we add a product as favourite, this message appears as an error.
Fatal error: Call to a member function setItems() on boolean in /home2/***/public_html/app/design/frontend/base/sinprecio/template/wishlist/view.phtml on line 43
This is the code in the view.phtml
<?php if ($this->helper('wishlist')->isAllow()) : ?>
<div class="my-wishlist">
<div class="page-title title-buttons">
<?php if ($this->helper('wishlist')->isRssAllow() && $this->hasWishlistItems()): ?>
<?php echo $this->__('RSS Feed') ?>
<?php endif; ?>
<h1><?php echo $this->getTitle(); ?></h1>
</div>
<?php echo $this->getMessagesBlock()->toHtml() ?>
<form id="wishlist-view-form" action="<?php echo $this->getUrl('*/*/update', array('wishlist_id' => $this->getWishlistInstance()->getId())) ?>" method="post">
<?php echo $this->getChildHtml('top'); ?>
<fieldset>
<?php if ($this->hasWishlistItems()): ?>
<?php echo $this->getBlockHtml('formkey');?>
<?php $this->getChild('items')->setItems($this->getWishlistItems()); ?>
<?php echo $this->getChildHtml('items');?>
<script type="text/javascript">decorateTable('wishlist-table')</script>
<?php else: ?>
<p class="wishlist-empty"><?php echo $this->__('You have no items in your wishlist.') ?></p>
<?php endif ?>
<div class="buttons-set buttons-set2">
<?php echo $this->getChild('control_buttons')->toHtml();?>
</div>
</fieldset>
</form>
<form id="wishlist-allcart-form" action="<?php echo $this->getUrl('*/*/allcart') ?>" method="post">
<?php echo $this->getBlockHtml('formkey') ?>
<div class="no-display">
<input type="hidden" name="wishlist_id" id="wishlist_id" value="<?php echo $this->getWishlistInstance()->getId() ?>" />
<input type="hidden" name="qty" id="qty" value="" />
</div>
</form>
<script type="text/javascript">
//<![CDATA[
var wishlistForm = new Validation($('wishlist-view-form'));
var wishlistAllCartForm = new Validation($('wishlist-allcart-form'));
function calculateQty() {
var itemQtys = new Array();
$$('#wishlist-view-form .qty').each(
function (input, index) {
var idxStr = input.name;
var idx = idxStr.replace( /[^\d.]/g, '' );
itemQtys[idx] = input.value;
}
);
$$('#qty')[0].value = JSON.stringify(itemQtys);
}
function addAllWItemsToCart() {
calculateQty();
wishlistAllCartForm.form.submit();
}
//]]>
</script>
</div>
<?php echo $this->getChildHtml('bottom'); ?>
<div class="buttons-set">
<p class="back-link"><small>« </small><?php echo $this->__('Back') ?></p>
</div>
And this is the line 43
<?php $this->getChild('items')->setItems($this->getWishlistItems()); ?>
Any clue? I'm kinda lost with this error. Thanks in advance!
Hi Plz check your wishlist.xml with below xml in your theme layout
<wishlist_index_index translate="label">
<label>Customer My Account My Wishlist</label>
<!-- Mage_Wishlist -->
<update handle="customer_account" />
<reference name="my.account.wrapper">
<block type="wishlist/customer_wishlist" name="customer.wishlist" template="wishlist/view.phtml">
<action method="setTitle" translate="title">
<title>My Wishlist</title>
</action>
<block type="wishlist/customer_wishlist_items" name="customer.wishlist.items" as="items" template="wishlist/item/list.phtml">
<block type="wishlist/customer_wishlist_item_column_image" name="customer.wishlist.item.image" template="wishlist/item/column/image.phtml" />
<block type="wishlist/customer_wishlist_item_column_comment" name="customer.wishlist.item.info" template="wishlist/item/column/info.phtml">
<action method="setTitle" translate="title">
<title>Product Details and Comment</title>
</action>
</block>
<block type="wishlist/customer_wishlist_item_column_cart" name="customer.wishlist.item.cart" template="wishlist/item/column/cart.phtml">
<action method="setTitle" translate="title">
<title>Add to Cart</title>
</action>
<block type="wishlist/customer_wishlist_item_options" name="customer.wishlist.item.options" />
</block>
<block type="wishlist/customer_wishlist_item_column_remove" name="customer.wishlist.item.remove" template="wishlist/item/column/remove.phtml" />
</block>
<block type="core/text_list" name="customer.wishlist.buttons" as="control_buttons">
<block type="wishlist/customer_wishlist_button" name="customer.wishlist.button.share" template="wishlist/button/share.phtml" />
<block type="wishlist/customer_wishlist_button" name="customer.wishlist.button.toCart" template="wishlist/button/tocart.phtml" />
<block type="wishlist/customer_wishlist_button" name="customer.wishlist.button.update" template="wishlist/button/update.phtml" />
</block>
</block>
</reference>
<reference name="right">
<action method="unsetChild"><name>wishlist_customer_sidebar</name></action>
</reference>
</wishlist_index_index>
I'm trying to move the toplinks to a static block that I created above the header. Currently, I'm only getting the "Log Out" link instead of all of the top links (My Account, My Wishlist, My Cart, and Checkout). How can I get all these links into the static block?
2columns-right.phtml
<head>
<?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">
<div><?php echo $this->getChildHtml('newreference') ?></div>
<?php echo $this->getChildHtml('header') ?>
<div class="main-container col2-right-layout">
<div class="main">
<?php echo $this->getChildHtml('breadcrumbs') ?>
<div class="col-main">
<?php echo $this->getChildHtml('global_messages') ?>
<?php echo $this->getChildHtml('content') ?>
</div>
<div class="col-right sidebar"><?php echo $this->getChildHtml('right') ?></div>
</div>
</div>
<?php echo $this->getChildHtml('footer') ?>
<?php echo $this->getChildHtml('global_cookie_notice') ?>
<?php echo $this->getChildHtml('before_body_end') ?>
</div>
</div>
<?php echo $this->getAbsoluteFooter() ?>
</body>
</html>
newReference.phtml
<p class="welcome-msg"><?php echo $this->getChildHtml('welcome') ?> <?php echo $this->getAdditionalHtml() ?></p>
<div class="quick-access">
<?php echo $this->getChildHtml('topLinks') ?>
</div>
local.xml
<?xml version="1.0" encoding="UTF-8"?>
<layout>
<default>
<reference name="root">
<block type="core/text_list" name="newreference" as="newreference" translate="label">
<label>New Reference</label>
</block>
</reference>
<reference name="newreference">
<block type="core/template" name="newreferenceblock" template="newreference.phtml">
<block type="page/template_links" name="top.links" as="topLinks"/>
</block>
</reference>
</default>
</layout>
Try this
<reference name="newreference">
<block type="core/template" name="newreferenceblock" template="newreference.phtml">
<block type="page/template_links" name="top.links" as="topLinks"/>
</block>
</reference>
change this to
<reference name="newreference">
<block type="core/template" name="newreference" template="newReference.phtml">
<block type="page/template_links" name="top.links" as="topLinks"/>
</block>
</reference>
i have a problem with structural block in magento 1.9.
This is my local.xml layout file:
<layout version="0.1.0">
<default>
<reference name="root">
<block type="core/template" name="pluma" as="pluma" template="pluma/helloworld/simple_page.html"/>
</reference>
</default>
This is my 1column.phtml template file:
<body<?php echo $this->getBodyClass()?' class="'.$this->getBodyClass().'"':'' ?>>
<?php echo $this->getChildHtml('after_body_start') ?>
<div class="wrapper">
<?php echo $this->getChildHtml('global_notices'); ?>
<pre><?php echo $this->getChildHtml('pluma'); ?></pre>
<div class="page">
<?php echo $this->getChildHtml('header') ?>
<div class="main-container col1-layout">
<div class="main">
<?php echo $this->getChildHtml('breadcrumbs') ?>
<div class="col-main">
<?php echo $this->getChildHtml('global_messages') ?>
<?php echo $this->getChildHtml('content') ?>
</div>
</div>
</div>
<?php echo $this->getChildHtml('footer_before') ?>
<?php echo $this->getChildHtml('footer') ?>
<?php echo $this->getChildHtml('global_cookie_notice') ?>
<?php echo $this->getChildHtml('before_body_end') ?>
</div>
</div>
<?php echo $this->getAbsoluteFooter() ?>
</body>
And this is my template file (very simple):
<h1 style="background-color:yellow">Hello New Reference!</h1>
Magento response only "empty" tags. I don't understand my error..
Thanks in advance..
Try to use .phtml (default template files for magento) file instead of .html :
<layout version="0.1.0">
<default>
<reference name="root">
<block type="core/template" name="pluma" as="pluma" template="pluma/helloworld/simple_page.phtml"/>
</reference>
</default>
Also make sure you change the name in pluma/helloworld : simple_page.html -> simple_page.phtml
this is my layout xml:
<catalog_category_default translate="label">
<label>Catalog Category (Non-Anchor)</label>
<reference name="content">
<block type="core/template" name="page.brand" template="page/brand.phtml" />
<block type="catalog/product_list" template="page/accessories.phtml">
<block type="catalog/navigation" name="catalog.leftnav" as="filter_menu" template="catalog/navigation/left.phtml"/>
</block>
</reference>
</catalog_category_default>
And from within page.accessories.phtml, inside some div block i call:
<?php echo $this->getChildHtml('filter_menu') ?>
but nothing renders out. Why is that?
this is code from the layered phtml file:
<div class="oh_shit"></div>
<?php if($this->canShowBlock()): ?>
<div class="block block-layered-nav">
<div class="block-title">
<strong><span><?php echo $this->__('Shop By') ?></span></strong>
</div>
<div class="block-content">
<?php echo $this->getStateHtml() ?>
<?php if ($this->getLayer()->getState()->getFilters()): ?>
<div class="actions"><?php echo $this->__('Clear All') ?></div>
<?php endif; ?>
<?php if($this->canShowOptions()): ?>
<p class="block-subtitle"><?php echo $this->__('Shopping Options') ?></p>
<dl id="narrow-by-list">
<?php $_filters = $this->getFilters() ?>
<?php foreach ($_filters as $_filter): ?>
<?php if($_filter->getItemsCount()): ?>
<dt><?php echo $this->__($_filter->getName()) ?></dt>
<dd><?php echo $_filter->getHtml() ?></dd>
<?php endif; ?>
<?php endforeach; ?>
</dl>
<script type="text/javascript">decorateDataList('narrow-by-list')</script>
<?php endif; ?>
</div>
</div>
<?php endif; ?>
Try adding your blocks in your layout xml to:
<catalog_category_layered translate="label">
<label>Catalog Category</label>
<reference name="content">
<block type="core/template" name="page.brand" template="page/brand.phtml" />
<block type="catalog/product_list" template="page/accessories.phtml">
<block type="catalog/navigation" name="catalog.leftnav" as="filter_menu" template="catalog/navigation/left.phtml"/>
</block>
</reference>
</catalog_category_layered>
ok. i got it. i accidentally deleted the name attribute on the block with type="product_list". when i re-added the name="product_list" it worked.
I'm trying to move magentos advanced search link from the footer links right beneath the search bar.
I know that the origins of the link are in layout/catalogsearch.xml under
reference name="footer_links" and appear in the footer because of getChildHtml('footer_links') in footer.phtml
And i know that the search bar originates from template/catalogsearch/form.mini.phtml and appears though catalogsearch.xml under reference name="top.menu"
Any ideas on how to proceed here?
thank you for the quick answer!
But it is not exactly what I was looking for as it would display the entire footer links block beneath the searchbar.
Nevertheless thank you for showing me the method you used for that!
Anyways, I figured out a solution on my own:
I modified catalogsearch.xml:
<default>
<reference name="top.menu">
<block type="core/template" name="top.search" as="topSearch" template="catalogsearch/form.mini.phtml"/>
</reference>
<!-- add a new reference to top.search including my new adv.search block -->
<reference name="top.search">
<block type="page/template_links" name="adv.search" as="adv.search" >
<action method="addLink" translate="label title" module="catalogsearch">
<label>Advanced Search</label>
<url helper="catalogsearch/getAdvancedSearchUrl" />
<title>Advanced Search</title>
</action>
</block>
</reference>
<!-- the reference to the footer i commented out as its not longer needed; it includes advanced search and popular search terms-->
</default>
In form.mini.phtml I added a new div that calls adv.search:
</script>
<div class="adv-search"> <?php echo $this->getChildHtml('adv.search') ?> </div>
</div>
And last, in styles.css, I added some code to controll the looks of that div:
.adv-search {width:100px; height:15px; margin-top:24px; margin-left: 120px;}
.adv-search a { color:#fff; font-weight:bold; }
any additional advice is more than welcome
Cheers!
In order for this to work, you must:
1) Update your app/design/frontend/[yourtheme]/default/layout/local.xml file
2) Call the new blocks in app/design/frontend/[yourtheme]/default/template/page/html/header.phtml - this is needed because header.phtml is not a "core/text_list" block type which automatically renders its nested blocks. So we must explicitly tell Magento to render those child blocks
Your app/design/frontend/[yourtheme]/default/layout/local.xml should contain this:
<?xml version="1.0"?>
<layout version="0.1.0">
<default>
<reference name="header">
<!-- Insert cms links. No need to use <action method="insert"> as this block is not used elsewhere in layout -->
<block type="cms/block" name="top_links_cms" as="top_links_cms" before="top_links_other">
<action method="setBlockId"><block_id>footer_links</block_id></action>
</block>
<!-- Insert former footer links. -->
<action method="insert">
<!-- We must keep block name "footer_links" as it is used as a reference for adding links by other modules -->
<blockName>footer_links</blockName>
<!-- Name of the block we want to have as sibling (in order to get its position and place our block after it. See next node <after> -->
<siblingName>topSearch</siblingName>
<!-- $after param from Mage_Core_Block_Abstract::insert() is a boolean type, so its value in the XML node is [empty], 0 or 1 -->
<after>1</after>
<alias>top_links_other</alias>
</action>
</reference>
<reference name="footer">
<action method="unsetChild"><name>footer_links</name></action>
<action method="unsetChild"><name>cms_footer_links</name></action>
</reference>
</default>
</layout>
This is an updated header.phtml you can get inspiration from for your app/design/frontend/[yourtheme]/default/template/page/html/header.phtml file:
<div class="header-container">
<div class="header">
<?php if ($this->getIsHomePage()):?>
<h1 class="logo"><strong><?php echo $this->getLogoAlt() ?></strong><img src="<?php echo $this->getLogoSrc() ?>" alt="<?php echo $this->getLogoAlt() ?>" /></h1>
<?php else:?>
<strong><?php echo $this->getLogoAlt() ?></strong><img src="<?php echo $this->getLogoSrc() ?>" alt="<?php echo $this->getLogoAlt() ?>" />
<?php endif?>
<div class="quick-access">
<?php echo $this->getChildHtml('topSearch') ?>
<?php
/**
* Add other top links (footer and cms links)
*/
?>
<?php echo $this->getChildHtml('top_links_cms') ?>
<?php echo $this->getChildHtml('top_links_other') ?>
<p class="welcome-msg"><?php echo $this->getWelcome() ?> <?php echo $this->getAdditionalHtml() ?></p>
<?php echo $this->getChildHtml('topLinks') ?>
<?php echo $this->getChildHtml('store_language') ?>
</div>
<?php echo $this->getChildHtml('topContainer'); ?>
</div>
</div>
<?php echo $this->getChildHtml('topMenu') ?>