Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Nofollow Navigation
 
galvingreenonline
Jr. Member
 
Total Posts:  11
Joined:  2009-01-29
Manchester, UK
 

I’m trying to figure out how to add the rel="nofollow" attribute to some sections of my store to try and shape the PR of some of my pages. For example I want to add nofollow to the section ‘My Account’, I have found the code which is as follows:

<div class="box account-nav">
<div class="head">
<h3><?php echo $this->__('My Account'); ?></h3>
</div>
<ul>
<?php $_links = $this->getLinks(); ?>
<?php $_index = 1; ?>
<?php $_count = count($_links); ?>
<?php foreach ($_links as $_link): ?>
<?php $_last = ($_index++ >= $_count); ?>
<?php if ($this->isActive($_link)): ?>
<li class="on<?php echo ($_last ? ' last' : '') ?>"><?php echo $_link->getLabel() ?></li>
<?php else: ?>
<li<?php echo ($_last ? ' class="last"' : '') ?>><a href="<?php echo $_link->getUrl() ?>"><?php echo $_link->getLabel() ?></a></li>
<?php endif; ?>
<?php endforeach; ?>
</ul>
</div>

Where and more importantly how do I add the nofollow to this?! PHP isn’t my strong point :(

 
Magento Community Magento Community
Magento Community
Magento Community
 
J_T_
Mentor
 
Avatar
Total Posts:  1961
Joined:  2008-08-07
London-ish, UK
 

The HTML code is built in this line:

<a href="<?php echo $_link->getUrl() ?>"><?php echo $_link->getLabel() ?></a>

Change that to:

<a href="<?php echo $_link->getUrl() ?>” rel="nofollow"><?php echo $_link->getLabel() ?></a>

That should be it.

 
Magento Community Magento Community
Magento Community
Magento Community
 
galvingreenonline
Jr. Member
 
Total Posts:  11
Joined:  2009-01-29
Manchester, UK
 

Thanks! I will give this a go now.

 
Magento Community Magento Community
Magento Community
Magento Community
 
galvingreenonline
Jr. Member
 
Total Posts:  11
Joined:  2009-01-29
Manchester, UK
 

Just to check, shoule it be… <rel="nofollow"> instead of ” rel="nofollow">?

 
Magento Community Magento Community
Magento Community
Magento Community
 
galvingreenonline
Jr. Member
 
Total Posts:  11
Joined:  2009-01-29
Manchester, UK
 

Anyone else any ideas on this?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Mirasvit
Guru
 
Avatar
Total Posts:  639
Joined:  2009-08-22
 

It is possible that you need something like this extension Advanced SEO Suite http://mirasvit.com/magento-extensions/advanced-seo-suite.html

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