Move Layered Navigation below Widget/Banner display - magento

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>

Related

how to display a text on right using magento

I have written a code that displays a text hello world on right of the magento homepage, but however when I browse to other links like My Account, My WishList etc., it disappears. My question is how will I be able to display Hello World in every pages using reference name="right"?
<default>
<reference name="right">
<block type="core/template" name="catalog.helloworld" template="catalog/helloworld.phtml" />
</reference>
</default>
It works when I write reference name = "content".
The text is displayed where the block "right" is present, you can search your project for <remove name="right"/> and find where right block has been removed for the pages (my wishlist, myaccount, etc..)
Now you can enable this block by removing these tags, or (recommended) you can create your own block and add it to layout/page.xml

How to remove right sidebar in magento 1.9

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.

Adding a block to magento category page using local.xml

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>

Can't add layered navigation block into CMS page

I need to show new products on a CMS page. It works fine. Then I need to add the layered navigation block on the left to filter out the selection. But it never works. I add this code into the Layout Update XML field:
<reference name="left">
<block type="catalog/navigation" name="catalog.leftnav" template="catalog/navigation/left.phtml"></block>
</reference>
I tried with block type core/template, but it still doesn't work. Does anyone know why it never works?
you can not call layer navigation using this type of code.For layer navigation on cms yo
u need a category or if you do not have category then put root category id,whose id 2(Default category)
here details of link
https://stackoverflow.com/questions/21241181/cms-page-with-layered-navigation-not-working/21242296#21242296https://stackoverflow.com/questions/21241181/cms-page-with

Magento 'Sort By' - How to make Magento forget which option was selected

Something that I have not noticed before is that Magento will remember which option you've selected to 'Sort By' on category list pages. So if you go to a category page, and lets say the default sort is ordered by price, if you change the sort to be ordered by name instead, the page reloads and all is well.
However, if you remove the get variable(s) in the URL and reload the page, it still sorts by name instead of reverting back to price.
I was thinking this was a problem specific to the site I'm working on, as there are some custom things happening with collection building and sorting and such, but I've now checked a handful of other Magento sites (some of which I found at random on the web) and they all do the same thing.
Does anyone know how this is being 'remembered'? Is this stored in user's session? I would think it's part of caching, but this site is still in development and thus caching is disabled.
It's not that big of a deal, but it does seem like a bug.
The sort order parameter is stored in session. See Mage_Catalog_Block_Product_List_Toolbar::getCurrentOrder method. You can switch it off by calling Mage_Catalog_Block_Product_List_Toolbar::disableParamsMemorizing method or by setting params_memorize_allowed in catalog session. I mean Mage::getSingleton('catalog/session')->setParamsMemorizeAllowed(true)
What worked for me is adding this in local.xml:
<!--
Category default layout
-->
<catalog_category_default translate="label">
<!-- Disable memorizing toolbar parameters -->
<reference name="content">
<reference name="product_list_toolbar">
<action method="disableParamsMemorizing" />
</reference>
</reference>
</catalog_category_default>
<!--
Category layered navigation layout
-->
<catalog_category_layered translate="label">
<!-- Disable memorizing toolbar parameters -->
<reference name="content">
<reference name="product_list_toolbar">
<action method="disableParamsMemorizing" />
</reference>
</reference>
</catalog_category_layered>

Resources