Cant find footer links in Magento - magento

I am trying to change the links in the footer of a Magento page.
In the footer there is the following HTML:
<div class="col1 gapRight floatLeft">
<h2>Customer Service</h2>
<ul>
<li>About Us</li>
<li>Customer Service</li>
<li class="last privacy">Privacy Policy</li>
<li class="last privacy">Contact Us</li>
</ul>
<ul class="links">
<li class="first" ><a href="/index.php/catalog/seo_sitemap/category/" title="Site Map" >Site Map</a></li>
<li ><a href="/index.php/catalogsearch/term/popular/" title="Search Terms" >Search Terms</a></li>
<li ><a href="/index.php/catalogsearch/advanced/" title="Advanced Search" >Advanced Search</a></li>
<li ><a href="/index.php/sales/guest/form/" title="Orders and Returns" >Orders and Returns</a></li>
<li class=" last" ><a href="/index.php/contacts/" title="Contact Us" >Contact Us</a></li>
</ul>
</div>
The first ul list is defined as a CMS Static Block called footer_links.
Can anyone tell me where I can find the second ul list?
Ive googled about and I keep getting reffered back to the Static Blocks. This second ul list is definitely not a Static Block (Ive gone as far as removing all the static blocks and this list is still there). Where else could it be defined?

Your template is using the core footer links, stored in XML files.
Open your Magento folder, go to app/design/frontend/. When you are in your template folder open the Layout folder. You may need to create and overwrite if they don't exist.
Site Map
In catalog.xml file:
<reference name="footer_links">
<action method="addLink" translate="label title" module="catalog" ifconfig="catalog/seo/site_map">
<label>Site Map</label><url helper="catalog/map/getCategoryUrl" />
<title>Site Map</title>
</action>
</reference><br>
Search Terms and Advanced Search
In catalogsearch.xml:
<reference name="footer_links">
<action method="addLink" translate="label title" module="catalogsearch" ifconfig="catalog/seo/search_terms">
<label>Search Terms</label><url helper="catalogsearch/getSearchTermUrl" />
<title>Search Terms</title>
</action>
<action method="addLink" translate="label title" module="catalogsearch">
<label>Advanced Search</label>
<url helper="catalogsearch/getAdvancedSearchUrl" />
<title>Advanced Search</title>
</action>
</reference>
Contact Us
In contacts.xml file:
<reference name="footer_links">
<action method="addLink" translate="label title" module="contacts" ifconfig="contacts/contacts/enabled">
<label>Contact Us</label>
<url>contacts</url>
<title>Contact Us</title>
<prepare>true</prepare>
</action>
</reference>

Related

Magento 1.9 breadcrumbs always empty

I'm working on a magento ecommerce, I'm not the one who configured it or anything, I'm just doing his CSS, however, the site does not display the breadcrumbs.
Inside the "page / html / breadcrumbs.phtml" file I made a var_dump in the $ crumbs variable and it is always empty.
In the XML only in one situation the breadcrumbs is displayed in the frontend, when I enter the code inside the "default" tag if I put this code inside "customer_account_login" nothing will be displayed on the front.
Code of breadcrumbs.phtml:
<?php if($crumbs && is_array($crumbs)): ?>
<div class="breadcrumbs">
<ul>
<?php foreach($crumbs as $_crumbName=>$_crumbInfo): ?>
<li class="<?php echo $_crumbName ?>">
<?php if($_crumbInfo['link']): ?>
<?php echo $this->htmlEscape($_crumbInfo['label']) ?>
<?php elseif($_crumbInfo['last']): ?>
<strong><?php echo $this->htmlEscape($_crumbInfo['label']) ?></strong>
<?php else: ?>
<?php echo $this->htmlEscape($_crumbInfo['label']) ?>
<?php endif; ?>
<?php if(!$_crumbInfo['last']): ?>
<?php endif; ?>
</li>
<?php endforeach; ?>
</ul>
</div>
<?php endif; ?>
Here part of code of "customer.xml"
<?xml version="1.0"?>
<layout version="0.1.0">
<default>
<!-- Mage_Customer -->
<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>
<!-- HERE BREADCRUMBS DISPLAYS ON ALL PAGES THE SAME CONTENT "HOME / MY ACCOUNT" -->
<reference name="breadcrumbs">
<action method="addCrumb">
<crumbName>Home</crumbName>
<crumbInfo><label>Home</label><title>Home</title><link>/</link></crumbInfo>
</action>
<action method="addCrumb">
<crumbName>My Account</crumbName>
<crumbInfo><label>My Account</label><title>My Account</title><link>/customer/account/</link></crumbInfo>
</action>
</reference>
</default>
<!-- 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="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>
<!-- Layout for customer login page -->
<customer_account_login translate="label">
<label>Customer Account Login Form</label>
<!-- Mage_Customer -->
<remove name="right"/>
<remove name="left"/>
<reference name="root">
<action method="setTemplate"><template>page/1column.phtml</template></action>
</reference>
<reference name="content">
<block type="customer/form_login" name="customer_form_login" template="customer/form/login.phtml" />
</reference>
</customer_account_login>
If I move the breadcrumbs code from "< default >" to the "< customer_account_login translate="label" >" for example, all screens returns the breadcrumbs as null.
I have no idea what's going on. I just wish all the screens had their breadcrumbs being displayed.
Check that breadcrumbs are actually enabled in the back end admin panel like below.

Magento Call custom block inside another custom block

I am new to magento, so please forgive me if I have asked anything wrong. I have created a custom module for instagram Login, I just want to call a particular block from that instagram module to another layout file. I have called that block printed in my view page using
<?php echo $this->getChildHtml('media_new'); ?>
My block got called but functionalities are working and form is not submitting.
My custom module layout file. Instagram.xml
<?xml version="1.0"?>
<layout version="0.1.0">
<default>
<reference name="content">
</reference>
</default>
<instagram_index_instagram_signup>
<reference name="head">
<action method="addJs"><script>magenthemes/jquery/plugins/jquery.cookie.js</script></action>
</reference>
<reference name="content">
<block type="core/template" name="instagram.signup" template="instagramlogin/Instagram_signup.phtml"></block>
</reference>
</instagram_index_instagram_signup>
</layout>
I want to call the above block to another module layout file:
My another module layout page:
<marketplace_vendor_login>
<reference name="head">
<action method="addJs"><script>magenthemes/jquery/plugins/jquery.cookie.js</script></action>
</reference>
<remove name="right"/>
<remove name="left"/>
<reference name="before_body_end">
<block type="facebookfree/init" name="belvg_facebookfree_block">
<action method="setTemplate" ifconfig="facebookfree/settings/enabled" ifvalue="1">
<template>belvg/facebookfree/block.phtml</template>
</action>
</block>
</reference>
<reference name="root">
<action method="setTemplate"><template>page/1column.phtml</template></action>
</reference>
<reference name="content">
<block type="marketplace/vendor_login" name="customer_form_login" template="nbmpmarketplace/login.phtml" >
<block type="facebookfree/links_button" name="belvg_facebookfree_button" template="belvg/facebookfree/form/button.phtml" />
<block type="core/template" name="instagram.signup" as="media_new" template="instagramlogin/Instagram_signup.phtml"></block>
</block>
</reference>
</marketplace_vendor_login>
Here I have called my custom block, then printed in my view page as:
<?php echo $this->getChildHtml('media_new'); ?>
My controller code for instagram:
class Blazedream_Instagram_IndexController extends Mage_Core_Controller_Front_Action
{
public function instagram_signupAction()
{
if ($this->getRequest()->isPost()){
if($this->getRequest()->getPost('instagram-email')){
$instagram_email = $this->getRequest()->getPost('instagram-email');
$customer_model = Mage::getModel('instagram/instagram');
$site_customer = $customer_model->checkCustomer($instagram_email);
if($site_customer){
$instagram_customer = Mage::getModel('instagram/instagram')->getCollection()
->addFieldToFilter('customer_id', array('eq' => $site_customer));
if(count($instagram_customer)==1){
Mage::getSingleton('core/session')->setInstagramEmail($instagram_email);
$this->_redirect('instagram/index');
}else{
Mage::getSingleton('customer/session')->addError('Email Id Already Registered.');
$this->_redirect('sellerlogin');
}
}else{
Mage::getSingleton('core/session')->setInstagramEmail($instagram_email);
$this->_redirect('instagram/index');
}
}
}
$this->loadLayout();
$this->getLayout()->getBlock('instagram.signup');
$this->renderLayout();
}
}
It is not coming into this controller function, That i have used for instagram module.
My view page: instagramlogin.phtml
<div style="display: none">
<style type="text/css">
#cboxContent.newsletterbox {
<?php if($backgroundImage){?> background-image: url(<?php echo Mage::getBaseUrl('media').'/wysiwyg/magenthemes/newsletter/'.$backgroundImage;?>);
<?php }?> background-position: left top;
background-repeat: no-repeat;
background-color: <?php echo $backgroundColor;?>;
}
</style>
<div id="mt_instagram" class="block block-subscribe">
<div class="row">
<div class="left-newletters col-lg-8 col-md-8 col-sm-8 col-xs-8">
<div class="block-title">
<strong><span><?php echo $this->__('Join our Mail List Through Instagram!') ?></span></strong>
</div>
<div class="row-none">
<div class="popup_message">
<div class="intro">
<?php echo $desc; ?>
</div>
<form action="<?php echo Mage::getBaseUrl().'instagram/index/instagram_signup'; ?>" method="post" id="instagram-validate-detail">
<div class="block-content">
<div class="input-box">
<input name="instagram-email" type="text" id="mt-newsletter" placeholder="Enter your email id"
value="" class="input-text required-entry validate-email"/>
<div class="actions">
<button type="submit" title="<?php echo $this->__('Subscribe') ?>"
class="button">
<span><span><?php echo $this->__('Subscribe') ?></span></span></button>
</div>
</div>
</div>
</form>
</div>
</div>
I am getting my custom form also..But the controller is not getting called and functionalists are not working, only I am getting the form.
Can anyone help Me?
This is my first ever answer on stackoverflow, I will try my best to explain.
To start with, let me brief you about the block calls in Magento; any particular type of Block(.php files in Block folder) has a corresponding content/template (.phtml in template folder) file to render the data fetched from Model (.php in Model folder).
In your layout (.xml for your module in layout folder), you have added a block that is of type (core/template) so it will call the file Mage_Core_Block_Template.php and can access all its methods. However, if you want to create a custom block you can update layout (instagram module) file like this.
<layout version="0.1.0">
<default>
<reference name="content">
</reference>
</default>
<instagram_index_instagram_signup>
<reference name="head">
<action method="addJs"><script>magenthemes/jquery/plugins/jquery.cookie.js</script></action>
</reference>
<reference name="content">
<block type="instagram/instagram" name="instagram.signup" template="instagramlogin/Instagram_signup.phtml"></block>
</reference>
</instagram_index_instagram_signup>
</layout>
And create a file in Block folder with name Blazedream_Instagram_Block_Instagram.php and then you will be able to call custom methods to the block template.
Ex.-
class Blazedream_Instagram_Block_Instagram extends Mage_Core_Block_Template
{
public function customMethod()
{
$response = array('a', 'b', 'c');
$this->getResponse()->setHeader('Content-type','application/json', true);
$this->getResponse()->setBody(Mage::helper('core')->jsonEncode($response));
return;
}
}
Update you controller action call to
$this->loadLayout();
$this->renderLayout();
Now, to add this block inside another custom module, update its layout like
<fname_controller_action>
//path controller path on which you want to add/update the block
<update handle="my_custom_handle" />
</fname_controller_action>
<my_custom_handle>
<reference name="content">
<reference name="where_you_want_to_add">
<block type="instagram/instagram" name="my.custom.block" as="instagram.signup" template="template_path/instagram.phtml"/>
</reference>
</reference>
</my_custom_handle>
or add a constructor inside the block file Blazedream_Instagram_Block_Instagram.php like -
public function __construct()
{
parent::__construct();
$this->setTemplate('template/instagram.phtml');
}
and call the block in any template file with the below code
echo $this->getLayout()->createBlock('instagram/instagram')->toHtml();
You might need to update your layout file in this case.
If you do everything correctly, you should be able to call $this->customMethod() in the template file instagram.phtml
Thanks! Pardon me if I could not explained it properly.

how to remove the 'home' link from top menu in magento?

I have a website where i don't want the 'home' link in top menu, I just want to remove or disable it...I have tried this link
http://www.magentocommerce.com/boards/viewthread/60059/
but it didn't find any code in top.phtml (app > design > frontend > default (or whatever theme you have) > catalog > navigation > top.phtml ) like-
<li> yada /home statement </li>
or
<li><?php echo $this->__('Home') ?></li>
I have only
<?php $_menu = $this->renderCategoriesMenuHtml(0,'level-top') ?>
<?php if($_menu): ?>
<div class="nav-container">
<ul id="nav">
<?php echo $_menu ?>
</ul>
</div>
<?php endif ?>
Please give a solution.
I already tried using xml in customer.xml file but may be I didn't use it in proper xml file or proper code.
<reference name="top.links">
<action method="removeLinkByUrl">
<url helper="core/url/getHomeUrl" />
</action>
</reference>
Try this in the local.xml file of your active theme.
<default>
<reference name="root">
<reference name="top.links">
<action method="removeLinkByUrl"><url helper="core/url/getHomeUrl"/></action>
</reference>
</reference>
</default>
As a hack you can hide it using css
find the class and add .class { display:none }
At last, I figured it out.The Home link is there because of the menu plugin(custom responsive menu'). I disabled it from backend.

My Account display only after login

I would like to change top links
in the default set magento display
My Account | My Wishlist | My Cart | Checkout | Log in
i need to change top link that to show My Account link only after when user is LogIn
thx for help
in customer.xml at your theme before it is look like
<default>
<!-- Mage_Customer -->
<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>
</default>
<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>
Remove my account link from default tag to Customer_logged_in
Change it with
After change at customer.xml
<default>
<!-- Mage_Customer -->
<reference name="top.links">
</reference>
</default>
<!--
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>My Account</label><url helper="customer/getAccountUrl"/><title>My Account</title><prepare/><urlParams/><position>10</position></action>
<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>
hope this will sure help you.
<customer_logged_in>
<reference name="top.links">
<action method="addLink" translate="label title">
<label>Your Account</label>
<url helper="customer/getAccountUrl" />
<prepare/>
<urlParams/>
<liParams>
<id>header-account-link</id>
</liParams>
<aParams/>
<beforeText/>
<afterText/>
</action>
</reference>
We can do that easily Suppose We need to show only My-Account link after sign In,
we have to override the authorization.phtml file in custom theme and we can put our logic based on our requirement.
app/design/frontend/Namespace/Custom theme/Magento_Customer/templates/account/link/ authorization.phtml
After overriding this file we can put our login -
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
/** #var \Magento\Customer\Block\Account\AuthorizationLink $block */
$objectManagerlogin = \Magento\Framework\App\ObjectManager::getInstance();
$baseurl = $objectManagerlogin->get('Magento\Store\Model\StoreManagerInterface')->getStore(0)->getBaseUrl();
$dataPostParam = '';
if ($block->isLoggedIn()) {
$dataPostParam = sprintf(" data-post='%s'", $block->getPostParams());
}
?>
<?php if($block->isLoggedIn() && $baseurl || $block->isLoggedIn() ) : ?>
<li class="authorization-link" >
Sign Out
</li>
<li class="authorization-link custom-top-link-myaccount-mobile" >
My Account
</li>
<?php else : ?>
<li class="authorization-link" data-label="<?= $block->escapeHtmlAttr(__('or')) ?>">
<a <?= /* #noEscape */ $block->getLinkAttributes() ?><?= /* #noEscape */ $dataPostParam ?>>
<?= $block->escapeHtml($block->getLabel()) ?>
</a>
</li>
<?php endif; ?>
I hope this will help you in Magento2, for managing my account section based own need

how to add another HTML element in top.links after list element? NOT adding link

How can i add another element after <li>
So i can get this tree structure <ul><li><span><a>Logout</a></span></li></ul>
Currently my rendered html is looking like this. I want to have span element to do bit more with logout. I have tried a lot but no luck. Please help. Thank you
<ul class="links">
<li class="first last">
Logout
</li>
</ul>
layout to top.links is
<customer_logged_in>
<reference name="account.links">
<action method="addLink" translate="label title" module="customer">
<label>Logout</label>
<url helper="customer/getLogoutUrl"/>
<title>Log Out</title>
<prepare/>
<urlParams/>
<position>2</position>
<liParams></liParams>
<aParams>class="logout-link"</aParams>
</action>
<action method="removeLinkByUrl">
<url helper="customer/getRegisterUrl" />
</action>
</reference>
If i am changing the links.phtml then change will apply for all the links or else i need to put if else in there but i needed it only for logout. so what is the best way to do that?
Is this achievable using addLinks method?
You can do this using the beforeText and afterText parameters, like this:
<action method="addLink" translate="label title" module="customer">
<label>Logout</label>
<url helper="customer/getLogoutUrl"/>
<title>Log Out</title>
<prepare/>
<urlParams/>
<position>2</position>
<liParams></liParams>
<aParams>class="logout-link"</aParams>
<beforeText><![CDATA[<span>]]></beforeText>
<afterText><![CDATA[</span>]]></afterText>
</action>
Which will modify your link to look something like this:
<li class="first last">
<span>Logout</span>
</li>
You can create your own template (a copy of links.phtml) and apply it only for Top Links.
Do it like this in your theme's local.xml:
<default>
<reference name="top.links">
<action method="setTemplate">
<template>page/template/my_links.phtml</template>
</action>
</reference>
<default>
Then copy page/template/links.phtml and rename it to page/template/my_links.phtml and do whatever you need inside that new template file. It will be only used to render Top Links, not for any other links

Resources