-
AuthorPosts
-
pixelzombie Friend
pixelzombie
- Join date:
- August 2010
- Posts:
- 339
- Downloads:
- 2
- Uploads:
- 49
- Thanks:
- 32
- Thanked:
- 168 times in 107 posts
December 22, 2010 at 12:06 pm #157761If your’e like me and want to add cryptic virtuemart URL’s to the MegaMenu that should not be indexed, you can follow this short tutorial on how to add a Parameter to enable rel=”nowfollow” to any menu item.
Here we go :laugh:
plugins/system/jat3/core/params/params.xml
add the following parameter:
<param name="mega_nofollow" type="radio" default="0" label="Set nofollow" description="Sets a rel=nofollow on the link">
<option value="0">No</option>
<option value="1">Yes</option>
</param>
plugins/system/jat3/core/menu/base.class.php
1. Add this block arround line 343
//Add nofollow
$nofollow = "";
$val = $tmp->megaparams->get('nofollow');
if ($val == 1 ) {
$nofollow = "rel="nofollow"";
}2. Seek and replace the following lines (from top to bottom):
Seek
$data = '<a href="#" '.$active.' '.$id.' '.$title.'>'.$txt.'</a>';
replace with
$data = '<a rel="nofollow" href="#" '.$active.' '.$id.' '.$title.' '.$nofollow.'>'.$txt.'</a>';
Seek
$data = '<a href="'.$tmp->url.'" '.$active.' '.$id.' '.$title.'>'.$txt.'</a>';
replace with
$data = '<a href="'.$tmp->url.'" '.$active.' '.$id.' '.$title.' '.$nofollow.'>'.$txt.'</a>';
Seek
$data = '<a href="'.$tmp->url.'" target="_blank" '.$active.' '.$id.' '.$title.'>'.$txt.'</a>';
replace with
$data = '<a href="'.$tmp->url.'" target="_blank" '.$active.' '.$id.' '.$title.' '.$nofollow.'>'.$txt.'</a>';
Seek
$data = '<a href="'.$link.'" onclick="window.open(this.href,'targetWindow',''.$attribs.'');return false;" '.$active.' '.$id.' '.$title.'>'.$txt.'</a>';
replace with
$data = '<a href="'.$link.'" onclick="window.open(this.href,'targetWindow',''.$attribs.'');return false;" '.$active.' '.$id.' '.$title.''.$nofollow.'>'.$txt.'</a>';
Seek
$data = '<a '.$active.' '.$id.' '.$title.'>'.$txt.'</a>';
replace with
$data = '<a '.$active.' '.$id.' '.$title.' '.$nofollow.'>'.$txt.'</a>';
Note: since this is a hack you have to apply it every time you update the t3 plugin. Or maybe the guys from joomlart turn this hack into a feature :p
I hope I could help a little with this 😉
Cheers
1 user says Thank You to pixelzombie for this useful post
April 5, 2011 at 1:26 pm #384977Hi and thanks for this clear tutorial. I did from top to bottom and got Set Nofollow option in the Parameters (JA Extended).
I went and selected no follow to all items i needed to have nofollow enabled but still when i do View Source from FF and search for nofollow, there is 0 results. Does it work as it is or there are some other adjustments that need to e done.
Also, is there any other way to add nofollow to the mega menu links/items?Thanks
pixelzombie Friendpixelzombie
- Join date:
- August 2010
- Posts:
- 339
- Downloads:
- 2
- Uploads:
- 49
- Thanks:
- 32
- Thanked:
- 168 times in 107 posts
April 22, 2011 at 11:52 am #387634Hey pmetz,
the tutorial works as it is but the ja-t3 plugin changed in the meantime so there may be changes in the sourcecode that prevents the hack to work. I’ll have a look into this when I’ve got time to spare on this. Maybe you can provide your t3 plugin version and a link to your site?
Cheers
pixelzombie Friendpixelzombie
- Join date:
- August 2010
- Posts:
- 339
- Downloads:
- 2
- Uploads:
- 49
- Thanks:
- 32
- Thanked:
- 168 times in 107 posts
August 18, 2012 at 12:35 am #464588Hey shimiread,
unfortunately I’ve got barely time writing up some tutorials, doing a video is not possible at the moment. I’m glad you’re happy with the html version 😉
Cheers
Frank
-
AuthorPosts
This topic contains 4 replies, has 2 voices, and was last updated by pixelzombie 12 years, 2 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum