Thursday, October 17, 2013

How to activate new adminhtml theme in Magento?

Within config.xml under etc folder of your module, add the following


    <stores>
        <admin>
            <design>
                <package>
                    <name>NameSpace</name>
                </package>
                <theme>
                    <default>theme</default>
                </theme>
            </design>
        </admin>
    </stores> 
 
 
Assuming you created your theme under app/design/adminhtml/NameSpace/theme

Magento: Include Layered Navigation In A CMS Page (Home Page)

This is another popular question. Often you want to show items on a CMS page rather than a regular category page. But you still want to have the layered navigation to filter results like it appears by default with Magento at the category level (when listing products).
To add Magento’s layered navigation to a CMS page where you’re showing items simply edit your CMS page in the admin – under the “Design” tab put this code:

<reference name="left">
    <block type="catalog/layer_view" name="catalog.leftnav" before="-" template="catalog/layer/view.phtml"/>
</reference>

 
That will show the layered navigation at the very top of the left column on your CMS page. Of course make sure your CMS page layout is “2column with left bar” (under “layout” in the “Design” tab).

<reference name="left">
    <block type="catalog/layer_view" name="catalog.leftnav" before="-" template="catalog/layer/view.phtml"/>
</reference>

<reference name="left">
    <block type="checkout/cart_sidebar" name="cart_sidebar" template="checkout/cart/sidebar.phtml" before="-">
<action method="addItemRender"><type>simple</type><block>checkout/cart_item_renderer</block><template>checkout/cart/sidebar/default.phtml</template></action>
        <action method="addItemRender"><type>grouped</type><block>checkout/cart_item_renderer_grouped</block><template>checkout/cart/sidebar/default.phtml</template></action>
        <action method="addItemRender"><type>configurable</type><block>checkout/cart_item_renderer_configurable</block><template>checkout/cart/sidebar/default.phtml</template></action>
        <block type="core/text_list" name="cart_sidebar.extra_actions" as="extra_actions" translate="label" module="checkout">
            <label>Shopping Cart Sidebar Extra Actions</label>
        </block>
    </block>
   
    <block type="poll/activePoll" name="left.poll" after="left.permanent.callout">
        <action method="setPollTemplate"><template>poll/active.phtml</template><type>poll</type></action>
        <action method="setPollTemplate"><template>poll/result.phtml</template><type>results</type></action>
    </block>
</reference>
<reference name="content">
   <block type="catalog/product_new" name="product_new" template="catalog/product/list.phtml">
      <action method="setColumnCount"><column_count>4</column_count></action>
      <action method="setProductsCount"><count>0</count></action>
      <block type="catalog/product_list_toolbar" name="product_list_toolbar" template="catalog/product/list/toolbar.phtml">
         <block type="page/html_pager" name="product_list_toolbar_pager" />
         <action method="setDefaultGridPerPage"><limit>12</limit></action>          
      </block>    
   </block>
</reference>