how to add custom page layout pages magento - magento

I have custom layout page
I have added the following code to app/code/core/Mega/page/etc/config.xml
<shop_overview module="page" translate="label">
<label>Shop OverView Page</label>
<template>page/shop_overview.phtml</template>
<layout_handle>shop_overview</layout_handle>
</shop_overview>
This show the "Shop Over View Page" on admin panel in page layout drop-down
I want to remove product list from category for this page layout only.
I tried the following but it is not working.
<shop_overview translate="label">
<label>All One-Column Layout Pages</label>
<reference name="root">
<action method="setTemplate">
<template>page/shop_overview.phtml</template>
</action>
<action method="setIsHandle"><applied>1</applied></action>
</reference>
<reference name="category.products">
<remove name="product_list" />
</reference>
</shop_overview>

Instead of this you can assign static block to this category by changing display mode to Static Block Only.
And then creating and selecting that block for that category.
Reference Link: http://leveluptuts.com/tutorials/magento-community-tutorials/19-how-add-static-block-category-page

Related

Put a banner on top of two column cms page in magento

I created a new CMS with 2column layout and now want to put full width or 1 column banner on top of 2 columns.
I tried
<reference name="root">
<block type="cms/block" name="my_banner" as="my_banner" template="path/to/my_banner.phtml" />
</reference>
in Layout Update XML but nothing happened. Any help will be appreciated!
As per #richtea response I updated the CMS page layout settings like the screenshot given below but didn't worked
http://screencast.com/t/CiidoSRgkNs
You are requesting the page to add a CMS block, but referencing a PHTML template. You can either:
Insert a CMS block, use the below and create a block in your admin panel with identifier my_banner.
<reference name="root">
<block type="cms/block" name="my_banner">
<action method="setBlockId"><block_id>my_banner</block_id></action>
</block>
</reference>
Or insert a template file as follows
<reference name="root">
<block type="core/template" name="my_banner" as="my_banner" template="path/to/my_banner.phtml" />
</reference>

how to change the category block right to left in magento?

i use the magento 1.9 and install the MA2 theme.
how to category block change right to left column?
plz check this image below=" http://postimg.org/image/jcs8mssct/"
You can change the category layout via the backend :
catalog > Manage categories > select your category > Custom design tab > page layout and change it to 2columns with left bar, but I don't think this will work with your template, it will change the page layout but it will not show the category list, it may show Magento layer nav if your category is anchor
or you can use your local.xml to add this :
<catalog_category_default translate="label">
<reference name="root">
<action method="setTemplate"><template>page/2columns-left.phtml</template></action>
</reference>
<reference name="right">
<remove name="category.list"/>
</reference>
<reference name="left">
<block type="catalog/navigation" name="category.list" before="-" template="catalog/navigation/category_list.phtml"/>
</reference>
</catalog_category_default>
On MA2 template you can use the same code above on ma2\default\layout\local.xml

How to add different static block to every category

I want to add different static block to every category at some specific places on the page.
how would i do that.????
Reference http://www.partybounty.com
here the blocks in footer and banner are different for every category.
Or you can use Layout Update XML (under custom design tab) on each category which can be controlled from the admin a bit like;
<reference name="content">
<remove name="breadcrumbs" />
<reference name="category.products">
<action method="setPageTitleDisabled"><disabled>1</disabled></action>
</reference>
<block type="page/html_wrapper" name="category.home.left">
<action method="setElementTagName"><value>div</value></action>
<action method="setElementClass"><value>col-left sidebar col3</value></action>
<block type="manufacturers/navigation_left" name="category.home.leftnav" template="manufacturers/navigation/left.phtml"/>
</block>
<remove name="category.description" />
<block type="page/html_wrapper" name="category.home.right" after="category.home.left">
<action method="setElementTagName"><value>div</value></action>
<action method="setElementClass"><value>category-home</value></action>
<block type="core/template" name="category.home.description" template="catalog/category/description.phtml" />
</block>
<block type="catalog/navigation" name="category.home.categories" template="catalog/navigation/categories.phtml" after="category.description">
<action method="setIsMini"><value>1</value></action>
</block>
<block type="homepage/homepagebanner" name="category.home.banner" after="category.home.categories">
<action method="setIsCategory"><value>1</value></action>
</block>
<block type="bestsellers/slider" name="category.home.bestsellers" after="category.home.banner" />
<block type="bundlekits/slider" name="category.home.bundlekits" after="category.home.banner" />
<block type="featuredproducts/listing" name="category.home.featured" after="category.home.bestsellers" />
</reference>
This gives you flexibility for different positioning and including different blocks on a per category basis, downside is it's a little time consuming to setup.
Did you try
Go to Admin Catalog - Manage categories
choose your category
go to Display Mode & choose either static block only or static block & products
go to CMS block & choose the block you have created
See How do I create and edit Static Blocks?
If you want to add the static block to the header/footer you may have to
add a field to your category see http://magecracker.wordpress.com/2012/07/19/how-to-add-custom-fieldattribute-in-magento-category/
then
<?php echo Mage::app()->getLayout()
->createBlock('cms/block')
->setBlockId(Mage::registry('current_category')->getData('block id from custom field'))->toHtml(); ?>
You call following in any category page. You can create different static blocks for each categories and call them depending on requirement or selecting from category edit page
<?php $app = Mage::app(); ?>
<?php echo $app->getLayout()
->createBlock('cms/block')
->setBlockId('your_block_id')->toHtml(); ?>

How to I show a category list on inner pages in Magento?

In the Magento theme I am using there is a left sidebar, on the homepage the sidebar contains a category list but on inner pages (category page, product page, etc) the list isn't there. How can I replicate this block onto the product and category page so that users can choose a category from anywhere?
You can include the block in the layout(catalog.xml) under the section
Product view
<catalog_product_view translate="label">
<reference name="left">
Your block comes here
</reference>
</catalog_product_view></li>
Category Page
<catalog_category_default translate="label">
<reference name="left">
Your block comes here
</reference>
</catalog_category_default></li>
Otherwise just put in the deafult section of the catalog.xml, I am thinking that should also work.
<default>
<reference name="left">
Your block comes here
</reference>
</default>
I think the block that ususally displays the left navigation of category is
<reference name="left">
<block type="catalog/navigation" name="catalog.leftnav" after="currency" template="catalog/navigation/left.phtml"/>
</reference>
Hope this helps you to some extent.
Cheers

Magento: product specfic designs through 'Custom Layout Update'

If I want to control how each product is displayed (i.e. a custom design when specified) my first thought is to do this:
Create a custom view.phtml in template/catalog/product/my_view.phtml
Navigate in the admin to Product->Design->Custom Layout Update
Add this block:
<reference name="content">
<action method="setTemplate">
<template>catalog/product/view_print.phtml</template>
</action>
</reference>
But the template is never loaded, only the default view.phtml. Is this the correct method? I need to be able to do this in the product settings.
Found the answer:
<reference name="product.info">
<action method="setTemplate"><template>catalog/product/NEW_VIEW.phtml</template></action>
</reference>
Navigate in the admin to Product->Design->Custom Layout Update > Add the below custom block. > It works for all the stores.
"<reference name="product.info">
<block type="namespace_modulename/catalog_product_list_custom"
name="catalog.product.modulename" as="modulename" after="tierprices"
template="modulename/catalog/product/modulename.phtml"/>
</reference> "
Add the below code in view.phtml
<?php echo $this->getChildHtml('modulename'); ?>

Resources