This module is small, but fantastic at the same time.
I found out that it didn't work properly with my multilingual site.

I hacked the code to support i18n, but I'm new to "Patching", so would like someone to add the patch from the code below, or instruct me on how to add a patch.


/**
 * Override of theme_menu_item_link()
 * This function will render link if it is "nolink" or "separator". Otherwise it will call originally 
 * overwriten menu_item_link function. 
 */
function special_menu_itemsoverwrite_menu_item_link($link) {   
  $theme_overwrite=variable_get('oldtheme_menu_item_link',null);
  
  if (empty($link['localized_options'])) {
    $link['localized_options'] = array();
  }

  if(strpos($link['href'], 'nolink') === 0) {

    // Verify that i18n module is installed, otherwise skip check
    if (module_exists('i18n')) {
       // Verify that the link is set for the current language
       if (i18n_get_lang() != $link['localized_options']['langcode'])
           return;
    }

    // Allow if the menu link is nolink:
    $link['localized_options']['html'] = TRUE;
    
    //Retrieve tag for nolink menu item
    $tag=variable_get('special_menu_items_nolink_tag','<span>');
    
    //Set class for nolink
    $css='nolink';
 
    //Return HTML span instead of a link
    return render_menu_item($tag,$link['title'],$css);
  }
  else if(strpos($link['href'], 'separator') === 0) {
    // Allow if the menu link is seperator
    $link['localized_options']['html'] = TRUE;
    
    //Retrieve tags and value for seperator menu item
    $tag=variable_get('special_menu_items_seperator_tag','<span>');
    $value=variable_get('special_menu_items_seperator_value','--------');
    
    //Set class for seperator
    $css='seperator';

    //Return separator menu item
    return render_menu_item($tag,$value,$css);
  }
  else
     return call_user_func($theme_overwrite, $link);
}

Thanks,
Zion

Comments

zzadik’s picture

Title: Multilingual (i18n) support » Special Menu Items - Multilingual (i18n) support
tamerzg’s picture

Thanks, I will review it.

metabits’s picture

subscribing

mariusilie’s picture

any news regarding this issue?

dtsio’s picture

any news?

khaled.zaidan’s picture

Hi,

We're a bit busy here. I will do my best to look into this soon and review it.

Best regards,
Khaled Zaidan

alex.skrypnyk’s picture

bump

kimlop’s picture

this patch is necessary, please include it on the module
thx

gagarine’s picture

Version: 6.x-1.3 » 6.x-1.x-dev
Priority: Normal » Major
Status: Needs review » Needs work

Thanks zzadik for working on that

Someone can please make a patch for 7.x and if possible 6.x?

gagarine’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev

BTW perhaps it works already for D7

gagarine’s picture

Status: Needs work » Postponed (maintainer needs more info)

Someone can test on D7?

candelas’s picture

i used in drupal 7.8 and internationalization and i am able to translate it and no problems.
i didnt use the patch...
thanks a lot for your work :)

edit it works in the interface but when you create a new node, the menu item that it is translated gets duplicated in the select to choose a menu parent item...
but not only with this module, but with any menu item created directly from the menu.
i opened an issue in the internationalization module http://drupal.org/node/1269318
if i found a solution, i will tell here.

gagarine’s picture

Version: 7.x-1.x-dev » 6.x-1.x-dev
Status: Postponed (maintainer needs more info) » Active

Thanks a lot for your tests :).

I'm not going to work on the D6 (I do not have any D6 websites using this module) but if someone can provide a patch it will be great.

A cleaner solution would be to port the way of the D7 version work to D6.

vrajak@gmail.com’s picture

StatusFileSize
new22.53 KB

Needing some help with this. Applying the hack from the first post does remove the names of the menu items, but leaves the menu section visible. I attached a screnshot.

Any tips?

vijaycs85’s picture

Status: Active » Needs review
StatusFileSize
new2.89 KB

Not sure how helpful it is, but here is the patch for the code in description.