I have 2columns-right.phtml. how to move Shop By contents [which is in left sidebar] to Right Sidebar
In <catalog_category_layered> handle you need to put layer navigation block in 'Right' block as below:
<catalog_category_layered>
<reference name="right">
<block type="catalog/layer_view" name="catalog.leftnav" before="-" template="catalog/layer/view.phtml"/>
</reference>
</catalog_category_layered>
Add the above xml code in your theme layout local.xml file.
Turn on the Template Path Hint by going to the admin then navigating to System > Configuration > Developer > Debug section. When you are in the configuration page, select the store you are working in by using the top left website/store selector. Wait for the page to reload, and then select the Developer tab.
Select ”Yes” in the select box for Template Path Hints. Click Save. Go back to the store front, and reload. It says so in the template path. The immediate directory name following “template” is the name of the module through which a template is introduced. Copy the corresponding xml file from the base package to your custom design package.
In the layout updates search for .phtml file. You will find an area that looks like this: Change it to say the following instead
(Note that all you are doing is changing left to right)
<reference name="left">
to
<reference name="right">
Related
I installed magento 1.9.
After installed widget and slieshow, my page look like this,
Here i want to remove recently viewed products and compare products.
So i removed in app/design/frontend/modern/layout/catalog.xml ,(these lines i removed)
<block type="catalog/product_compare_sidebar" before="cart_sidebar" name="catalog.compare.sidebar" template="catalog/product/compare/sidebar.phtml"/>
But still stays sidebar.
can anyone help me?
go to magento admin click on cms home page , click on design now select layout 1 column now save and refresh page
To remove from Home Page to to Admin panel CMS/PAGES/Home Page then go to Design Tab there the first option is Layout. Change it to 1 column. SO it will change the layout of (only )Home Page to one column without left and right.
<div class="MagicSlideshow" data-options="width: 400px; height:187px;">
use this code
I just had this same problem, and was able to remove the compare block using xml.
In my situation, I did not want change to a 1-column layout because of what I've already done with the right-col layout.
Solution:
Copy "catalog.xml" from /app/design/frontend/base/default/layout or /app/design/frontend/rwd/default/layout if you're using the new rwd theme.
Go to line 55 and remove or comment out the entire <reference name="right"> block:
<reference name="right">
<block type="catalog/product_compare_sidebar" before="cart_sidebar" name="catalog.compare.sidebar" template="catalog/product/compare/sidebar.phtml"/>
<!--<block type="core/template" name="right.permanent.callout" template="callouts/right_col.phtml">-->
<!--<action method="setImgSrc"><src>images/media/col_right_callout.jpg</src></action>-->
<!--<action method="setImgAlt" translate="alt" module="catalog"><alt>Keep your eyes open for our special Back to School items and save A LOT!</alt></action>-->
<!--</block>-->
</reference>
Go to line 178 (for rwd_default) or 165 (for base_default) and remove or comment out the <customer_account_index> block of code:
<customer_account_index>
<reference name="right">
<action method="unsetChild"><name>catalog.compare.sidebar</name></action>
</reference>
Save the file into your custom theme layout folder as "catalog.xml".
You can unset the compare side bar in the layout file of your theme. I added a new file in
/app/design/frontend/myTheme/layout/local.xml
where I unset the compare side bar using:
<?xml version="1.0" encoding="UTF-8"?>
<layout>
<default>
<action method="unsetChild"><name>catalog.compare.sidebar</name></action>
</default>
</layout>
Don't edit the default files as they will get overwritten on update.
Before posting this, i have looked in to the following, but all of them did not helped me and i was not able to add the block.
magento - adding and positioning a block using local.xml
Magento - Add phtml file to layout block
Magento 1.7:Show category image on category page in full width in a 2 column template
I want to add the category image on top of the page. Currently it is displayed under the product list view, and i want it to be above the left navigation, so that it takes full page width.
I created a template file in mytheme/template/catalog/category/image.phtml and i just added some text "I am here".
After that i add the following xml to my local.xml file under catalog_category_default
<reference name="content">
<block type="catalog/category_view" name="category.image" template="catalog/category/image.phtml"></block>
</reference>
But it is still not working and the text is not displayed there. When this text is displayed, then i will display the category image, but for now i just want to make the block working and display it on top of the page.
Thank you
Maybe your category does not load the layout handle catalog_category_default. There are 2 handles for categories _default and _layered.
To make sure you cover both cases and so you won't duplicate markup try this approach.
define your custom handle.
<my_awsome_category_handle>
<reference name="content">
<block type="catalog/category_view" name="category.image" template="catalog/category/image.phtml"></block>
</reference>
</my_awsome_category_handle>
Then include that handle in both category handles.
<catalog_category_default>
<update handle="my_awsome_category_handle" />
</catalog_category_default>
<catalog_category_layered>
<update handle="my_awsome_category_handle" />
</catalog_category_layered>
I want to show a sidebar in the left side of customer account login page. I have successfully placed the sidebar in the product page by calling the navigation bar in catlog.xml file.
But doing the same method with the customer.xml file is not showing the sidebar.
Note
By going through the post "Magento: Display Categories in Sidebar" I had changed my sidebar in product page. But its not working for customer login page.
You need to first tell Magento to use the 2 column template for the Customer Account Login page - as standard it uses the 1 column template file and as such wont have either the left or right structural blocks for your sidebar to go into.
Simple to do - best practice would be to add the layout instruction to an existing or create a local.xml file in your app/design/frontend/YOUR_PACKAGE/YOUR_THEME/layout/ folder.
Using the handle <customer_account_login> so as to reference the login page, add the following to local.xml
<customer_account_login>
<reference name="root">
<action method="setTemplate"><template>page/2column-left.phtml</template></action><!-- Tells Magento to use 2 Column Left page template -->
</reference>
</customer_account_login>
This will use the template with a left sidebar.
Then, also within the same <customer_account_login> handle call in your block to the left structural block...
<customer_account_login>
<reference name="root">
<action method="setTemplate"><template>page/2column-left.phtml</template></action><!-- Tells Magento to use 2 Column Left page template -->
</reference>
<reference name="left"><!-- Tells Magento to place the following content in the left structural block-->
<!-- Your Block Goes Here -->
</reference>
</customer_account_login>
Done.
If you're not comfortable working in a local.xml file you can just amend the content of the <customer_account_login> handle in customers.xml to use the above mentioned "root" and "left" - you'll find it calls the page/1column.phtml file under root and of course wont yet have a <reference name="left">.
I am on EE but I believe the issue is the same for CE. What I want to do seems very simple. I want all banners in the left hand navigation on a category page to appear above the filter navigation. What I have tried is to change the XML file (search.xml in the case of EE, catalog.xml in the case of CE) by adding the after="-" call.
<catalog_category_layered>
<reference name="left">
<remove name="catalog.leftnav"/>
<block type="enterprise_search/catalog_layer_view" name="enterprisecatalog.leftnav" template="catalog/layer/view.phtml" after="-" />
</reference>
</catalog_category_layered>
However this does not change anything and Banners still load below Layered Navigation.
If I set the Widget to load in the left column on "All Pages", it will load properly at the top of the column. This solution is undesirable because it also loads the widget on the home page. We only want this to affect Category Pages.
I can also remove the XML block all together and load it as a banner in the widget which allows me to position it anywhere in the left column. This is also undesirable as it breaks our AJAX loading of the page when a layered navigation option is selected.
Does the widget/banner block have a name so I can say after="widget.banner.block.name" in the XML?
The only way I found to do this was to use JQuery to push the Widget containing the banners above the Layered Navigation after load.
//Move Category Widget zone above the layered navigation
jQuery(".catalog-category-view .col2-left-layout .col-left .widget").insertBefore(jQuery(".catalog-category-view .col2-left-layout .col-left .block-layered-nav"));
You should give your blocks names, and then order them as you wish like so:
<block type="whatever" name="something" as="something"
template="bla.phtml" before="-" />
<block type="whatever" name="something_else" as="something_else"
template="bla.phtml" after="something" />
<block type="whatever" name="something_new" as="something_new"
template="bla.phtml" after="something_else" />
If you wanted to show the widget on all pages APART from the home page you can set it to show on all pages, and then remove from the homepage only like this:
1) goto CMS -> Pages, then edit homepage
2) add layout update to the page, and specifically remove the widget block:
<reference name="left">
<action method="unsetChild"><alias>child_block_name</alias></action>
</reference>
How do I add an image to the left column on the homepage?
There's a simpler way of doing this:
in the admin go to CMS->Manage Pages
select the home page to edit it
on the left select the second tab(own layout)
as the layout choose either 3 colum or 2 column with left bar
in the xml changes field add this:
<reference name="left">
<block type="core/template" name="unique.id" template="callouts/left_col.phtml">
<action method="setImgSrc"><src>imageUrl</src></action>
<action method="setImgAlt" translate="alt" module="catalog"><alt>alternative text</alt></action>
</block>
</reference>
6. in the xml field change "imageUrl" to the address of your image, "alternative text" to the alternative description and unique.id to a unique id like advertisement.banner.left.
Go to the magento admin site, choose System->Configuration->Advanced->Developer and turn on template tag hints. (Make sure your store name is selected in the Current Configuration Scope dropdown)
You can then go back to your store homepage and you will be able to see which template is used for the left column.
Modify the .phtml template file and add your image there.