nofollow with extended menu

This forum is for general questions about extensions for Joomla! version 1.5.x.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Locked
Nic W
Joomla! Apprentice
Joomla! Apprentice
Posts: 43
Joined: Thu Dec 08, 2005 12:29 am

nofollow with extended menu

Post by Nic W » Tue Mar 31, 2009 5:40 pm

Hi,

I am looking at themeing / silo design and would like to add the rel="nofollow" link relationship attribute to certain menu items.

This can be done with a hack to Joomla component.xml as detailed here http://joomlacode.org/gf/project/joomla ... m_id=10218 which may become core, however I am using the extended menu module.

This module is new to me so I am not sure where I should be looking to add this attrbitue so could somebody point me in the right direction or advise what hack would be necessary in extended menus to achieve this.

Thanks,

Nic
Signature rules: Literal URLs only - http://forum.joomla.org/viewtopic.php?f=8&t=65

Nic W
Joomla! Apprentice
Joomla! Apprentice
Posts: 43
Joined: Thu Dec 08, 2005 12:29 am

Re: nofollow with extended menu

Post by Nic W » Wed Apr 01, 2009 3:42 pm

Aha! just need to modify the Extended Menu menuview.class.php

If you want to force all menu links by default to nofollow then just add;

Code: Select all

$nofollow = ' rel="nofollow" ';
before

Code: Select all

switch ($mitem->browserNav) {
and add

Code: Select all

$nofollow
to the link build for each case

Otherwise you need to use the hack I posted a link too in the previous post and pass over the status of the nofollow parameter to extended menu.

Can anybody give any pointers on getting the $params->def for each item of the joomla menu passed over into extended menu ?

:)
Signature rules: Literal URLs only - http://forum.joomla.org/viewtopic.php?f=8&t=65

Nic W
Joomla! Apprentice
Joomla! Apprentice
Posts: 43
Joined: Thu Dec 08, 2005 12:29 am

Re: nofollow with extended menu

Post by Nic W » Wed Apr 01, 2009 6:38 pm

looks like a problem firstly with the menu hack in the link above

the nofollow paramter is not being passed to helper.php for the standard menu so something is wrong, can somebody see whats up (parameter is defined in component.xml for the mainmenu and is set accordingly for the item(s))?

$iNofollow = $iParams->def('nofollow', 0);
if( $iNofollow == 1 )
$nofollow = ' rel="nofollow" ';
else
$nofollow = '';
Signature rules: Literal URLs only - http://forum.joomla.org/viewtopic.php?f=8&t=65

Nic W
Joomla! Apprentice
Joomla! Apprentice
Posts: 43
Joined: Thu Dec 08, 2005 12:29 am

Re: nofollow with ANY menu

Post by Nic W » Sat Apr 04, 2009 9:14 am

I found this thread;

http://forum.joomla.org/viewtopic.php?f ... 37&start=0

whch uses a slightly different approach, however they both modfy the helper.php file, even when I modify the helper.php and hand code rel="nofollow" to any of the cases I still dont get a nofollow link, so I am confused as to what is actually building the menu links ?

I am using the mod_mainmenu on J1.5.10.

Also tried moding the legacy.php with no result

No matter what menu style I choose I dont get a nofollow - confusing ?

Can anybody help ?

:-\
Signature rules: Literal URLs only - http://forum.joomla.org/viewtopic.php?f=8&t=65

Nic W
Joomla! Apprentice
Joomla! Apprentice
Posts: 43
Joined: Thu Dec 08, 2005 12:29 am

attributes being stripped ?

Post by Nic W » Sat Apr 04, 2009 9:44 am

OK, if I manually add the rel="nofollow" and use the code above to pass the parameter from the item settings I get an XHTML parsing error saying that there are duplicate link attributes.....sounds good as it confirms that the attributes are obviously getting passed and are they appear in the link at some point...

However, when page finishes building all attributes are stripped from the link somewhere ?
Signature rules: Literal URLs only - http://forum.joomla.org/viewtopic.php?f=8&t=65

Nic W
Joomla! Apprentice
Joomla! Apprentice
Posts: 43
Joined: Thu Dec 08, 2005 12:29 am

Re: nofollow with ANY menu XHTML

Post by Nic W » Sun Apr 05, 2009 9:36 am

The thread below details the XHTML method for building the menu list....need to do some digging around there I think

http://forum.joomla.org/viewtopic.php?f=469&t=239751

Looks like JSimpleXMLElement could be the beast responsible...
Signature rules: Literal URLs only - http://forum.joomla.org/viewtopic.php?f=8&t=65

icecyboy
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Sun Nov 28, 2010 9:12 am
Location: Thailand
Contact:

Re: nofollow with ANY menu

Post by icecyboy » Sun Nov 28, 2010 10:03 am

Nic W wrote:I found this thread;

http://forum.joomla.org/viewtopic.php?f ... 37&start=0

whch uses a slightly different approach, however they both modfy the helper.php file, even when I modify the helper.php and hand code rel="nofollow" to any of the cases I still dont get a nofollow link, so I am confused as to what is actually building the menu links ?

I am using the mod_mainmenu on J1.5.10.

Also tried moding the legacy.php with no result

No matter what menu style I choose I dont get a nofollow - confusing ?

Can anybody help ?

:-\
I did this step too but still dont get a nofollow link.
What I should do?
กระเป๋าแฟชั่น
http://www.lady-choice.com


Locked

Return to “Extensions for Joomla! 1.5”