Display my account navigation links - magento

I have created custom page and added that link to my account page. But if I click on that link side bar disappears. How can I show my account navigation sidebar in my custom module page?

use update handle e.g.
<layout>
<cevent_index_index> --- your custom module handle in layout.xml
<update handle="customer_account"/> -- check customer.xml
<reference name="my.account.wrapper"> ---- block in customer_account handle
<block type="cevent/cevent" name="cevent" template="cevent/cevent.phtml"/>
</reference>
</cevent_index_index>
</layout>

Related

How do I add a new block to my layout in magento 1.9?

I have a beginner question on layouts ...After reading a lot about layouts, i am more confused than where i started. I want to add a banner block that will be displayed on my home page and a few other pages. I decided that it cannot be a part of the header.
I want to add this right below the header. I am trying to create my layout via bootstrap. I see in some themes that this is done inside the cms.xml file and i am not sure why i need to edit that. Clearly, i am confused..
Any help would be appreciated.
Go to your theme
app/design/frontend/Your-Package/Your-Theme/layout/local.xml
add below code:
<?xml version="1.0"?>
<layout version="0.1.0">
<cms_index_index>
<reference name="content">
<block type="core/template" name="banner" before="-" template="banner/banner.phtml" />
</reference>
</cms_index_index>
</layout>
add banner.phtml file to
app/design/frontend/Your-Package/Your-Theme/template/banner/banner.phtml
add your banner in above file
To add a block to any other page replace <cms_index_index> with <routname_controllername_actionname> For example, <catalog_product_view>.

remove/hide Layered Navigation when using static block only in Magento

When using option of 'Static block only' on the Category Page how can the Layered Navigation be hidden to create more room for the static blocks and then be visible if navigating to the same category page using a direct link in the url pointing to attribute?
Thanks
You can remove it through layout update
<reference name="left">
<remove name="catalog.leftnav" />
</reference>

Cms home page is not calling on front page having 3 columns

I want to show all my pages in 3 columns, But when i Changed the default cms Home page having 1 column to 3 columns then its content is not showing on front end only 3 columns structure is showing but its product page is not showing not even static data.
if anybody knows this then please help me out
thanks!
Home layout setting is managed from admin>CMS >Page .Please check admin >cms>page find home page and goes to its Design tab ,change here home page design
OR
go to you template folder create folder layout>create local.xml
frontend\your package\yourtemplate\layout\local.xml content is
<?xml version="1.0"?>
<layout version="0.1.0">
<default>
<reference name="root">
<action method="setTemplate"><template>page/1column.phtml</template></action>
</reference>
</default>
<catalog_product_view translate="label">
<reference name="root">
<action method="setTemplate"><template>page/1column.phtml</template></action>
</reference>

Magento Google Analytics Content Experiments

What is the simplest way to implement Google Analytics Content Experiment into Magento CE?
I want to test home page content.
Adding the Testing Code to CMS pages does not work. Testing Tag is after Analytics Tag.
Does Magento support adding the Testing Tag via admin Interface?
Or is there a simple way to add the tag via XML Layout Update?
Would it be possible to use Google Tag Manager to add the codes we need?
Tags could be installed after body like:
Add to local.xml in your layout folder following code:
<?xml version="1.0" encoding="UTF-8"?>
<!--
Last loaded layout file
-->
<layout>
<default>
<reference name="after_body_start">
<block type="cms/block" name="tags-first-in-body" before="-">
<action method="setBlockId"><block_id>tags-first-in-body</block_id></action>
</block>
</reference>
</default>
</layout>
and add a static block called tags-first-in-body.
Insert code to this block.

How do I add a new page to the customer account dashboard?

I have edited the customer.xml file to add a new link to the dashboard page. I added the following line
<action method="addLink" translate="label" module="customer"><name>newpage</name><path>customer/newpage/</path><label>My New Page</label></action>
I've also added the following block to customer.xml
<customer_newpage_index translate="label">
<label>Customer My newpage</label>
<!-- Mage_Customer -->
<update handle="newpage"/>
<reference name="my.account.wrapper">
<block type="customer/newpage" name="newpage" before="-" template="customer/newpage.phtml"/>
</reference>
</customer_newpage_index>
And added a template file at template/customer/newpage.phtml
The link displays, but I get a 404 page when I view /customer/newpage/
What am I missing here?
Thanks
You need to add a controller called NewpageController.php and in it have an action called indexAction. It is probably not a good idea to add this controller inside of the Customer module, because that is in core, and we never touch core. Instead, what you probably want to do is create your own module and put the controller inside of that. It can still be added as one of the links to the sidebar like you have done, but from the outside so that when you upgrade Magento you won't lose your controller.

Resources