It is required to totally clear the account dashboard page, to display custom layout which varies according to logged in customer's user group.
I did the following:
<customer_account_index translate="label">
<reference name="root">
<action method="setTemplate"><template>page/1column.phtml</template></action>
</reference>
<reference name="content">
<block type="MyModule/Dashboard" name="block_Dashboard" template="customer/Dashboard.phtml" />
</reference>
</customer_account_index>
I can see the output of 'customer/Dashboard.phtml', but how to remove all of these widgets?
Account Information
Contact Information
...
Can't find any layout handlers, nor the template reference for them in app/core/Mage/Customer/*
Where to dig ? Thanks!!!
It was inside the app/design/frontend/base/default/layout/customer.xml under the customer_account_index node.
Related
I want to create a static block on homepage in right side for user login. Please see the below screen short:-
enter image description here
Try to update a layout XML file app/design/frontend/*DEFAULT*/*DEFAULT*/layout/.
You also may create your own local.xml file and put it in the contents.
<layout version="0.1.0">
<default>
<reference name="right">
<block type="your/type" template="path/to/your/template.phtml" />
</reference>
</default>
</layout>
I'm using the pages that comes with the default instalation of magento on my web store. The customer want's to have diferent contents on right column of that pages.
For instance, on "customer-service" page wants to have the top FAQ's but on "contacts" want to have the telephone and mail information.
How can I achive that? I been trying to change the 2columns-right layout, on the right column, to each page but I was unable to find a way to do that.
Thanks in advanced.
In 'CMS > Pages' from the Magento back office, go into the 'Design' tab in each page you want to change and set the 'Layout' to '2 columns with rightbar'.
Then, you can use the right.permanent.callout block to call in what content you wish on various pages/page types as wanted.
For example, displaying an image in the right sidebar on contact page only:-
<contacts_index_index>
<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>
</contacts_index_index>
You can modify to change the page, page type, or template/block as you wish.
I'm trying to override
app/design/frontend/base/default/template/contacts/form.phtml.
I followed several guides without success:
I can only post one link since I don't have enough reputation to post more :(
http://www.magento.scommerce-mage.co.uk/override-phtml-or-layout-core-files-in-magento.html
In fact I'm even more confused now since they are all using different approaches. At the moment I'm trying to do it like in the last guide since this is the most up to date one(2014) without success so far.
So here is what I got:
app/code/local/Namespace/MyModule/etc/config.xml
<config>
<frontend>
<layout>
<updates>
<contactredirect>
<file>contactredirect.xml</file>
</contactredirect>
</updates>
</layout>
</frontend>
</config>
app/design/frontend/base/default/layout/contactredirect.xml
<layout version="0.1.0">
<contacts_index_index translate="label">
<reference name="contacts.form">
<action method="setTemplate">
<template>contactredirect/form.phtml</template>
</action>
</reference>
</contacts_index_index>
</layout>
And finally the location of my form.phtml (the content probably doesn't matter):
app/design/frontend/base/default/template/contactredirect/form.phtml.
Any help is appreciated!
use "contactForm" in reference name ie code should be--
<reference name="contactForm">
<action method="setTemplate">
<template>contactredirect/form.phtml</template>
</action>
</reference>
I am stuck at adding a url link in block programmatically, I need to add a URL to customized page which edited under CMS/page and I want to add it in .xml file by adding something like below.
<action method="addLink"
translate="label title"
module="catalog">
<label>My Account</label>
<url helper="customer/getAccountUrl" />
<title>My Account</title>
</action>
Above sample retrieve url from module, but no idea what are the parameters should be used for static CMS/page url. Please help me out.
Let me take an example of top.links block to explain this.
<block type="page/template_links" name="top.links" as="topLinks"/>
The “addLink” function is defined in Mage_Page_Block_Template_Links. The definition of the function is
public function addLink($label, $url='', $title='', $prepare=false, $urlParams=array(),
$position=null, $liParams=null, $aParams=null, $beforeText='', $afterText='')
Also the phtml file where the html code for this is written is ‘page/template/links.phtml’.
<reference name="top.links">
<block type="wishlist/links" name="wishlist_link">
<action method="addWishlistLink"></action>
</block>
</reference>
Answer to your question is pretty simple.
Suppose we need to add a new link to top links, lets say a link for a CMS page called Terms and Conditions. To do this open a layout file, let say customer.xml and add the below code:
<default>
<reference name="top.links">
<action method="addLink" translate="label title">
<label>Terms and Condition</label>
<url>terms</url>
<title>Terms and Condition</title>
<prepare>true</prepare>
<position>2</position>
</action>
</reference>
</default>
I have browsed through many articles, but none of them mention how I can go about redesigning the toplinks at the top of any Magento store.
Does anyone know how I can modify the default links which are found in the top right of my Magento store and assign an icon to each link and also spread the links across the full width of the top area.
It may include something like the below (example only).
Any suggestions would be much appreciated.
My website is: www.efficienttrade.co.nz if that helps.
Thanks,
Jason
Find the top.links in layout xml files and add a class. Then, you can customize this class via css.
For instance,
<!-- this piece of code available in rss.xml, look at the class define -->
<reference name="footer_links">
<action method="addLink" translate="label title" module="rss" ifconfig="rss/config/active"><label>RSS</label><url>rss</url><title>RSS</title><prepare>true</prepare><urlParams/><position/><li/><a>class="link-rss"</a></action>
</reference>
Same as Ogüz answer + more information:
You have to be a little bit like Sherlock Holmes.
The top links are generated thanks to a block that you can find in the layout file page.xml of your theme. Then search the block name "topLinks" in the header block (in the default theme, it's the name) and you will find <block type="page/template_links" name="top.links" as="topLinks"/>. This block topLinks is generated thanks to the block class Mage_Page_Block_Template_Links. The important method in this block is public function addLink(...), it means that you will have to search into the xml layout the following element/tag <action method='addLink'>...</action>.
An example for the customer module, in the file customer.xml of the layout folder:
<reference name="top.links">
<action method="addLink" translate="label title" module="customer"><label>My Account</label><url helper="customer/getAccountUrl"/><title>My Account</title><prepare/><urlParams/><position>10</position></action>
</reference>
You should find more than one xml element which uses this kind of method.
Pay attention, the addLink method can also be called programmatically (into PHP code), not only in layout file.
Hope it helps