Unfortunately NoFollow mambot will not work on menu items in your
Joomla because there is no Mambot event I could attach parsing
functions to.
There fore I came up with an idea to solve the issue. You'll have to
edit your Joomla source files. Please note that this procedure requires
some skills. You do that on your own risk.
Basically you need to change few lines of code. This tutorial is tested on joomla version 1.0.13
Unfortunately NoFollow mambot will not work on menu items in your
Joomla because there is no Mambot event I could attach parsing
functions to.
There fore I came up with an idea to solve the issue. You'll have to
edit your Joomla source files. Please note that this procedure requires
some skills. You do that on your own risk.
Basically you need to change few lines of code. This tutorial is tested on joomla version 1.0.13

STEP 1
Open your Joomla root directory and open file modules/mod_mainmenu.php and search for the following code (should be around line #112)
you should find something like this:
$mitem->name = stripslashes( ampReplace($mitem->name) );
add this code right bellow
// hack by vitez-studios.com $mitem->nofollow = ((strpos($mitem->link,'http://') === 0 || strpos($mitem->link,'https://') === 0) && strpos($mitem->link,$mosConfig_live_site) === false) ? ' rel="nofollow" ' : '';
STEP 2
Then find the following code (should be few lines bellow)
$txt = '<a href="'. $mitem->link .'" target="_blank" class="'. $menuclass .'" '. $id .'>'. $mitem->name .'</a>';
Replace it with following code:
$txt = '<a href="'. $mitem->link .'"'.$mitem->nofollow.' target="_blank" class="'. $menuclass .'" '. $id .'>'. $mitem->name .'</a>';
STEP 3
Find the following code (also few lines bellow)
$txt = '<a href="'. $mitem->link .'" class="'. $menuclass .'" '. $id .'>'. $mitem->name .'</a>';
Replace it with following code:
$txt = '<a href="'. $mitem->link .'"'.$mitem->nofollow.' class="'. $menuclass .'" '. $id .'>'. $mitem->name .'</a>';
Thats it! If you have cache enabled please clean all your caches to see changes in code.
|