Magento Category Custom Design Page Layout not changing - magento

I have turned off caching, but not matter what I do when I edit Admin -> Catalog -> Categories. Then click on the Custom Design and edit Page Layout, and layout from 1 - 3 columns.
None of the changes show up. I've tried this for the Default Site and specific site per category with no updates reflecting the front-end. I can edit the Custom Layout Update area and use something like:
<reference name="root">
<action method="setTemplate"><template>page/1column.phtml</template></action>
</reference>
Or I can edit the local.xml file and force all categories to be a specific layout:
<catalog_category_default>
<reference name="root">
<action method="setTemplate"><template>page/1column.phtml</template></action>
</reference>
</catalog_category_default>
<catalog_category_layered>
<reference name="root">
<action method="setTemplate"><template>page/1column.phtml</template></action>
</reference>
</catalog_category_layered>
However I need the Page Layout options to work. Maybe this has something to do with the layout in local.xml that add / removed things from the left and right side? As a note in the CMS Pages area, I can successfully change the Page Layout.

I found out the issue. I relied on another theme which forced the catalog_category_default to always render 2 columns. This was because update handle sets the applied variable to 1 which ignores admin page layout changes.
Here is what it is doing:
<catalog_category_default>
<update handle="page_two_columns_left"/>
...
</catalog_category_default>
So the only way I could override it was from my own XML update, but it still did not let me update the page layout from the admin.
<catalog_category_default>
<reference name="root">
<action method="setTemplate"><template>page/1column.phtml</template></action>
</reference>
</catalog_category_default>
So the fix was to set the applied variable to 0.
<catalog_category_default>
<reference name="root">
<action method="setIsHandle"><applied>0</applied></action>
<action method="setTemplate"><template>page/1column.phtml</template></action>
</reference>
</catalog_category_default>
This lets me use the Category Layout from the Custom Design tab in the Category Admin
I found this out by locating the handle and reviewing what variables it set. So here was the definition of page_two_columns_left:
<page_two_columns_left translate="label">
<label>All Two-Column Layout Pages (Left Column)</label>
<reference name="root">
<action method="setTemplate"><template>page/2columns-left.phtml</template></action>
<!-- Mark root page block that template is applied -->
<action method="setIsHandle"><applied>1</applied></action>
<action method="setLayoutCode"><name>two_columns_left</name></action>
</reference>
</page_two_columns_left>

Instead of using the reference code to change the layout, do so in admin control panel:
Go to categories / custom design
Find the page layout selection and change to 2 columns with either left or right bar.

Alternative solution:
use the layout update:
<reference name="root">
<action method="setTemplate"><template>page/2columns-left.phtml</template></action>
</reference>
In this way the page layout is changed regardless of the is_handle value

Related

how to change the design of product view page to 2columns-right in magento

I want to change the design of my product view page to 2columns-right. For that I changed in app/design/frontend/default/mytheme/catalog.xml to 2columns-right.
The code is
<reference name="root">
<action method="setTemplate"><template>page/2columns-right.phtml</template></action>
</reference>
After clearing the cache also,design is not changing it is still in 2columns-left panel.
In admin also, set no to apply to products,then also it is not changing.
If anyone have any idea to change the design in 2columns-left for detail page, then please help me.
Thanks!
Try like this
<catalog_product_view>
<reference name="root">
<action method="setTemplate"><template>page/2columns-right.phtml</template></action>
</reference>
</catalog_product_view>
create a local.xml file in layout directory and put this code inside it
<layout>
<catalog_product_view>
<reference name="root">
<action method="setTemplate"><template>page/2columns-right.phtml</template></action>
</reference>
</catalog_product_view>
</layout>

Change homepage to 1column.phtml in local.xml in new theme in Magento

I am new to Magento. I want to develop theme in it. I start to create it by create CSS, JavaScript and add this files to it and it work. I want to change template file for home page to 1column.phtml that is located in
my_theme/default/template/page/1column.phtml
Here is my code in local.xml file
<?xml version="1.0" encoding="UTF-8"?>
<layout>
<!--default layout-->
<default>
<reference name="head">
<action method="addItem"><type>skin_css</type><name>css/style.css</name></action>
</reference>
</default>
<cms_index_index>
<reference name="root">
<action method="setTemplate"><template>page/1column.phtml</template></action>
</reference>
<reference name="head">
<action method="addItem"><type>skin_js</type><name>js/script.js</name></action>
</reference>
</cms_index_index>
</layout>
But the result is used 3column.phtml as it default.
How can I set 1column.phtml to my Magento homepage?
you can simply do it without changing any core files:
Login to admin panel
Navigate to CMS->Pages
Go to the Page named Home Page, click on it.
On left hand panel go to the "Design " Tab
Under Page layout column, choose 1 column
Save
Please check the following image for more info:
When you edit any of the xml files you want to refresh the cache. This can be done by logging in to the admin and clicking system > cache management, then selecting all, and choosing refresh.
Alternatively you could disable all those caches while the project is in development. Same place, just a different option chosen.
EDIT
How about if you ignore the layout.xml and instead go to the magento admin to CMS>CMS Pages choose the home cms page, then go to design tab and put in the following
<reference name="root">
<action method="setTemplate"><template>page/1column.phtml</template></action>
<remove name="left" />
<remove name="right" />
</reference>
<reference name="head">
<action method="addItem"><type>skin_js</type><name>js/script.js</name></action>
</reference>

Edit template layout in Magento

I'm trying to edit the right sidebar of the homepage of a site based on Magento. When I edit the Layout Update XML field in the Custom design part of the homepage, I see this code:
<reference name="right">
<action method="unsetChild"><name>catalog.compare.sidebar</name></action>
<action method="unsetChild"><name>right.newsletter</name></action>
<action method="unsetChild"><name>cart_sidebar</name></action>
<block type="catalog/product_new" name="home.catalog.product.new" alias="product_new" template="catalog/product/new.phtml" after="cms_page"/>
</reference>
But I can't find where would be the layout specified in the block tag. When I remove the whole code, the sidebar is still displaying but with the Compare Sidebar Widet on top of the rest of teh sidebar.
I'm new to Magento and a little bit lost. Thank for your help.
use this
<remove name="catalog.compare.sidebar"/>
in default
like this
<default>
<reference name="right">
<remove name="catalog.compare.sidebar"/>
</reference>
</default>
it will work
The best way to accomplish is to create local.xml file under your themes layout section and paste this code. So you do not need to search in all the files.
<layout version="0.1.0">
<default>
<!-- remove compare sidebar -->
<remove name="catalog.compare.sidebar"/>
</default>
</layout>

Magento - layout template location change of reviews link (summary_short.phtml) on Catalog page

I've made a simple custom module that places the reviews on the Product page (instead of linking to the a new page as is the default).
Everything on the Product page is working perfectly. The link on the Catalog page is not. This still links to the "review page" instead of the Product page like it should. This is because I cannot seem to trigger a layout template location change for the summary_short.phtml in my custom xml layout file.
Here is my layout file contents:
<?xml version="1.0" encoding="UTF-8"?>
<layout version="0.1.0">
<default>
<reference name="head">
<action method="addItem"><type>skin_css</type><name>css/reviews.css</name></action>
</reference>
</default>
<!-- This works great -->
<catalog_product_view>
<reference name="content">
<reference name="product.info">
...
<action method="addReviewSummaryTemplate"><type>default</type><template>productpagereviews/review/helper/summary.phtml</template></action>
<action method="addReviewSummaryTemplate"><type>short</type><template>productpagereviews/review/helper/summary_short.phtml</template></action>
</reference>
</reference>
</catalog_product_view>
<!-- Below does not work at all -->
<catalog_category_default>
<reference name="content">
<reference name="product_list">
<action method="addReviewSummaryTemplate"><type>default</type><template>productpagereviews/review/helper/summary.phtml</template></action>
<action method="addReviewSummaryTemplate"><type>short</type><template>productpagereviews/review/helper/summary_short.phtml</template></action>
</reference>
</reference>
</catalog_category_default>
</layout>
I hate answering my own question AFTER I ask it - dang it! Regardless, I'm going to post the answer so others can know if they have trouble.
It turns out I needed a different main handle. The correct one was this catalog_category_layered. I still left the "default" tag there as I'm not exactly sure why this one works and catalog_category_default doesn't. If anyone can answer that, I'd be grateful!
The complete (chunk of) code would be as below:
<catalog_category_layered>
<reference name="product_list">
<action method="addReviewSummaryTemplate"><type>short</type><template>productpagereviews/review/helper/summary_short.phtml</template></action>
</reference>
</catalog_category_layered>
Now everything works as exactly as intended! Time for some more testing....
This may help answer your question about why one worked and not the other: http://kb.magenting.com/content/13/60/en/magento-is-anchor-option-in-category-properties.html
Essentially, *catalog_category_layered* is used when you have the category option "Is Anchor" enabled.

Magento - Changes to Edit Account Information screen do not get reflected

I have my custom theme, in which I would like to make changes to the Edit Account Information Screen. I have tried to modify this file:
customer/form/edit.phtml
No change that I make to this file gets reflected. I even removed all customer/form/edit.phtml files from the base and my custom theme. Even then, the screen renders.
This is the relevant code in my customer.xml file:
<customer_account_edit translate="label">
<label>Customer Account Edit Form</label>
<update handle="customer_account"/>
<reference name="root">
<action method="setHeaderTitle" translate="title" module="customer"><title>Edit Account Info</title></action>
</reference>
<reference name="my.account.wrapper">
<block type="customer/form_edit" name="customer_edit" template="customer/form/edit.phtml"/>
</reference>
<reference name="left">
<action method="unsetChild"><name>left.permanent.callout</name></action>
</reference>
</customer_account_edit>
What am I missing?
I found what was happening. I have an extension installed which has the following code:
<customer_account_edit translate="label">
<reference name="head">
<action method="addItem"><type>js_css</type><name>calendar/calendar-win2k-1.css</name><params/></action>
<action method="addItem"><type>js</type><name>calendar/calendar.js</name></action>
<action method="addItem"><type>js</type><name>calendar/calendar-setup.js</name></action>
</reference>
<reference name="content">
<block type="core/html_calendar" name="head.calendar" as="html_calendar" template="aitcheckoutfields/js/calendar.phtml"/>
</reference>
<reference name="customer_edit">
<action method="setTemplate"><template>aitcommonfiles/design--frontend--base--default--template--customer--form--edit.phtml</template></action>
</reference>
</customer_account_edit>
I commented out this code and now my edit.phtml is being used to render the form. I still do not understand, however, which phtml file this refers to?
Aitoc sometimes uses a funky rewrite method to generate template files for their modules. I had the same issue and eventually found my .phtml file in /var/ait_patch/design/frontend/default/default/template/aitcommonfiles
When files are missing from your custom theme the template system falls back to the equivalent files in the default/base theme. Also, Magento caches this so when new files are introduced it won't notice straight away and continue using the base files instead. Make sure you turn off all caches when developing.

Resources