When I'm logged in, sometimes my "Log Out" link shows in the top links section, sometimes not.
Seems to depend on the particular session, i.e. if I close my browser and come back later it might be there. Weird I know.
This code is in my customer.xml which appears to work sometimes.
<!--
Load this update on every page when customer is logged in
-->
<customer_logged_in>
<reference name="top.links">
<action method="addLink" translate="label title" module="customer"><label>Log Out</label><url helper="customer/getLogoutUrl"/><title>Log Out</title><prepare/><urlParams/><position>100</position></action>
</reference>
</customer_logged_in>
<!--
Load this update on every page when customer is logged out
-->
<customer_logged_out>
<!---<reference name="right">
<block type="customer/form_login" name="customer_form_mini_login" before="-" template="customer/form/mini.login.phtml"/>
</reference>-->
<reference name="top.links">
<action method="addLink" translate="label title" module="customer"><label>Log In</label><url helper="customer/getLoginUrl"/><title>Log In</title><prepare/><urlParams/><position>100</position></action>
</reference>
<remove name="reorder"></remove>
</customer_logged_out>
I figured something maybe overwriting it somehow later in the load chain, but I can't find any references to remove this link.
I also added this exact code to a local.xml file which should get loaded last .. no luck there.
Any thoughts on what's going on? I'm using Magento 1.6.1 community. It's seems to me this could be a bug, based on the erratic behavior pattern.
I am unable to post the snippet here becuase SO strips it too much, but here is your answer.
http://www.magentocommerce.com/boards/viewthread/52285/#t263743
Related
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
Can anyone tell me how to add links to the top menu of my Magento site.
Here it is - http://www.westoztools.com.au/working/index.php/
Please note that I have a left menu as well.
The way the top menu is built depends highly on your theme.
But if the theme follows standard behavior then you could add a link in the top menu through any layout xml file like this:
<default>
<reference name="top.links">
<action method="addLink" translate="label title">
<label>LINK LABEL HERE</label>
<url>relative url here</url>
<title>Link title here</title>
<prepare>1</prepare>
<urlParams/>
<position>100</position> <!-- feel free to change this -->
</action>
</reference>
</default>
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.
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.
I can't figure out how to get breadcrumbs to show up on the "Products tagged with" page in Magento. I get breadcrumbs everywhere else, including the search results page. Any help would be greatly appreciated.
Add the following layout update to the app/design/frontend/default/your_theme/layout/tag.xml file under <tag_product_list>:
<reference name="breadcrumbs">
<action method="addCrumb">
<crumbName>Home</crumbName>
<crumbInfo><label>Home</label><title>Home</title><link>/</link></crumbInfo>
</action>
<action method="addCrumb">
<crumbName>Tags</crumbName>
<crumbInfo><label>tagged products</label></crumbInfo>
</action>
</reference>
I guess it would be more desirable to have the second crumb change depending on the tag displayed, but this would require some more complex modifications. Let me know if you are interested and I might be able to help you out.