Magento Forum

   
How do I add the “about us” and “customer service” links to either the footer or the menu? 
 
Hoodgrown
Member
 
Avatar
Total Posts:  63
Joined:  2007-09-20
 

How do I add the “about us” and “customer service” links to either the footer or the menu in this theme?

 
Magento Community Magento Community
Magento Community
Magento Community
 
lisali
Enthusiast
 
Avatar
Total Posts:  888
Joined:  2008-04-28
London, UK
 

Hi - which theme? Do you mean the default Magento theme?

Those links should be there already, in the footer.

Lisa
smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
Hoodgrown
Member
 
Avatar
Total Posts:  63
Joined:  2007-09-20
 

Hey Lisa…
I’m using the Modern theme… and because of time limits.. beyond replacing the stock images… I haven’t modified it at all…

 
Magento Community Magento Community
Magento Community
Magento Community
 
lisali
Enthusiast
 
Avatar
Total Posts:  888
Joined:  2008-04-28
London, UK
 

I see.

Try going into:

CMS>>Static Blocks>>Footer Links

Strange - I see what you mean...those links are already defined there, but are not showing. Weird. Works fine with the default theme.

Maybe someone else can suggest what to do here, apart from editing one of the template files?

Lisa

 
Magento Community Magento Community
Magento Community
Magento Community
 
Hoodgrown
Member
 
Avatar
Total Posts:  63
Joined:  2007-09-20
 

still no dice.. no matter what I try.. the links don’t show in this template

 
Magento Community Magento Community
Magento Community
Magento Community
 
Crucial Web Host
Guru
 
Avatar
Total Posts:  364
Joined:  2007-11-08
Phoenix, AZ
 

Hello,

Give this a shot -

Admin -> System - Cache Management

‘All Cache’ -> Refresh -> save cache settings.

Hope this helps.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Hoodgrown
Member
 
Avatar
Total Posts:  63
Joined:  2007-09-20
 

thanks.. but that didn’t work either…

 
Magento Community Magento Community
Magento Community
Magento Community
 
Hoodgrown
Member
 
Avatar
Total Posts:  63
Joined:  2007-09-20
 

Any ideas why this isn’t working… where do I look and how would I add the link manually?

 
Magento Community Magento Community
Magento Community
Magento Community
 
lisali
Enthusiast
 
Avatar
Total Posts:  888
Joined:  2008-04-28
London, UK
 

Hi,

Not sure what else to suggest than editing the template file. To see what you need to edit, turn on template paths from the admin.
Let us know if that helps.

Good luck!

 
Magento Community Magento Community
Magento Community
Magento Community
 
enofman
Jr. Member
 
Total Posts:  11
Joined:  2007-08-31
 


@ Hoodgrown

I moved my site map and search terms to an additional bar above the search bar in the modern theme as in the graphic.
I could not have completed this mission with the excellent tutorial from Bill007 at the following:

http://www.magentocommerce.com/boards/viewthread/3454/. Big thank you to Bill007

However, I modified Bill007 to suit my needs. My file changes are as follows.

GO TO CMS AND THEN TO Static Blocks >> Add new Block

Block Title * Navigation Links

Identifier * nav_links

Choose your STORE (FOR ME ALL STORES)

Status * ENABLE

Content * <ul class="nav-links">
<li><a href="{{store url=""}}">Home</a></li>
<li><a href="{{store url=""}}about-magento-demo-store">About Us</a></li>
<li class"last"><a href="{{store url=""}}customer-service">Customer Service</a></li>

Now go to app/design/frontend/default/modern/layout/page.xml

add this code

<block type="page/template_links" name="top.links" as="topLinks"/>

<!-- BEGIN EDIT ADD TO PAGE.XML -->
<block type="page/html_nav" name="nav.links" as="navLinks" template="page/html/nav.phtml">
<block type="cms/block" name="nav_links">
<action method="setBlockId"><block_id>nav_links</block_id></action>
</block>
</block>
<!-- END OF EDIT -->

<block type="page/html_breadcrumbs" name="breadcrumbs" as="breadcrumbs"/>

Now go to apps/design/frontend/default/modern/template/page/html/

Create a new file called nav.phtml

Add this code

<?php
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@magentocommerce.com so we can send you a copy immediately.
*
* @category design_default
* @package Mage
* @copyright Copyright (c) 2004-2007 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
?>
<?php echo $this->getChildHtml()?>
<?php if($this->hasSeoLinks()>0):?>
<?foreach($this->getSeoLink() as $item):?>
<li><a href="<?=$item['url'];?>"><?=$item['title'];?></a></li>
<?endforeach;?>
</ul>
<?php endif;?>

This is Bill’s original code:

Now go to

apps/code/core/Mage/Page/Block/Html

CREATE A new file in the block folder called Nav.php {note you must use a capital N IN Nav.php}

and paste the following code into it

<?php
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@magentocommerce.com so we can send you a copy immediately.
*
* @category Mage
* @package Mage_Page
* @copyright Copyright (c) 2004-2007 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/

/**
* Html page block
*
* @category Mage
* @package Mage_Page
*/
class Mage_Page_Block_Html_Nav extends Mage_Core_Block_Template /* this needs to reflect the new name of the block file so for me Nav*/
{
protected $_seolinks;

protected function _prepareLayout()
{
parent::_prepareLayout();
$this->initSeoLink();
}

public function setCopyright($copyright)
{
$this->_copyright = $copyright;
return $this;
}

public function getCopyright()
{
if (!$this->_copyright) {
$this->_copyright = $this->getDesignConfig(’page/nav/copyright’);
}

return $this->_copyright;
}

public function getSeoLink()
{
return $this->_seolinks;
}

public function setSeoLink(array $varName)
{
$this->_seolinks=$varName;
}

public function addSeoLink(array $varName)
{
$this->_seolinks[]=$varName;
}

public function hasSeoLinks()
{
return count($this->_seolinks);
}

public function initSeoLink()
{
if(Mage::getStoreConfig(’catalog/seo/site_map’)){
$seolink[’title’]=$this->__(’Site Map’);
$seolink[’url’]=$this->helper(’catalog/map’)->getCategoryUrl();
$this->_seolinks[]=$seolink;
}
if(Mage::getStoreConfig(’catalog/seo/search_terms’)){
$seolink[’title’]=$this->__(’Search Terms’);
$seolink[’url’]=$this->helper(’catalogSearch/data’)->getSearchTermUrl();
$this->_seolinks[]=$seolink;
}
}
}

Image Attachments
home-page.png
 
Magento Community Magento Community
Magento Community
Magento Community
 
enofman
Jr. Member
 
Total Posts:  11
Joined:  2007-08-31
 

This is the continuation from previous post

@hoodgrown

Now go to app/design/frontend/default/modern/template/page

Add the following code to the following files:

1column.phtml, 2columns-left.phtml, 2columns-right.phtml, 3columns.phtml

code:  <div class="toplinks-bar">
<?php echo $this->getChildHtml('store_language') ?>
<?php echo $this->htmlEscape($this->getLayout()->getBlock('header')->getWelcome()) ?>
<?php echo $this->getChildHtml('topLinks') ?>
</div>
<!-- BEGIN EDIT ADDED -->
<div class="navlinks-bar">
<?php echo $this->getChildHtml('navLinks') ?>
</div>
<!-- END EDIT -->
<div class="search-bar">
<?php echo $this->getChildHtml('breadcrumbs') ?>
<?php echo $this->getChildHtml('topSearch') ?>
</div>

Now for the styling: 
Go to skin/frontend/default/modern/css

add the following to boxes.css right after

/********************** Header */

/* Logo */
h1#logo { float:left; }
.side-logo-promo { float:left; margin:10px 10px 10px 10px; }
.page-popup h1#logo { display:none; }
.language-switcher { float:left; }
.language-switcher label{ color:#fff;}
.toplinks-bar { background:#316430; color:#fff; padding:3px 10px 3px 15px; text-align:right; }
.toplinks-bar .top-links { padding-left:20px; font-size:1.10em;}
.toplinks-bar .top-links,
.toplinks-bar .top-links li { display:inline; }
.toplinks-bar .top-links li { padding:0 5px 0 1px; }
.toplinks-bar .top-links a,
.toplinks-bar .top-links a:hover { color:#ddd; }
.toplinks-bar .top-links a { padding:0 7px 0 0; background:url(../images/links_separator.gif) no-repeat 100% 50%; }
.toplinks-bar .top-links .last a { padding:0; background:none; }

code:
.navlinks-bar { background:#316430; color:#fff; padding:10px 10px 3px 15px; text-align:center; }
.navlinks-bar .nav-links { padding-left:30px; font-size:1.10em;}
.navlinks-bar .nav-links,
.navlinks-bar .nav-links li { display:inline; }
.navlinks-bar .nav-links li { padding:0 5px 0 1px; }
.navlinks-bar .nav-links a,
.navlinks-bar .nav-links a:hover { color:#ddd; }
.navlinks-bar .nav-links a { padding:0 7px 0 0; background:url(../images/links_separator.gif) no-repeat 100% 50%; }
.navlinks-bar .nav-links .last a { padding:0; background:none; }

change the color of the background color for your taste and the font color to suit.

I have one problem I have yet to figure out and that is the links_separator.gif appears as follows:

| Home | About Us | Customer Service | Site Map | Search Terms | after the search terms in every browser except firefox 3.0 and I can’t figure out how to get rid of it.

That’s it and Thank to Bill007 and the magento team because I followed bill007’s tutorial and followed magento teams top link bar.
There maybe a better way to do this however, this seems to be working thus far.

There it is grin

Image Attachments
home-page.png
 
Magento Community Magento Community
Magento Community
Magento Community
 
taikahn
Member
 
Total Posts:  35
Joined:  2008-04-07
 

wtf—all this to add a couple links—sigh.

 
Magento Community Magento Community
Magento Community
Magento Community
 
intensity
Member
 
Total Posts:  48
Joined:  2008-11-22
 

Holy crap.  There is a much easier way.  To put it in the navigation menu in the header do the following.

Edit “app/design/frontend/default/default/template/catalog/navigation/top.phtml

<?php //if(count($this->getStoreCategories())>1): ?>
    
<ul id="nav">
    
<?php foreach ($this->getStoreCategories() as $_category): ?>
        <?php 
echo $this->drawItem($_category?>
    <?php 
endforeach ?>
    
<li><a href="enter blog URL">Blog</a></li>  <--------Insert here
    
</ul>
<?php //endif; ?>

 
Magento Community Magento Community
Magento Community
Magento Community
 
taikahn
Member
 
Total Posts:  35
Joined:  2008-04-07
 

Yeah I just ended up editing the header file.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top