Saturday, February 19, 2011

How can I change some of Drupal's default menu strings without hacking the core files or using the String Override plugin?

Title says it all.

If you need more details, let me know.

EDIT: Changed title for clarity purposes.

From stackoverflow
  • Drupal provides Translations at their website...

    http://drupal.org/project/Translations

    : Yes... But where's the english one?
    Mez : drupal is in english...
  • Generally, this functionality would implemented via the locale module, which is part of Drupal core. The module is very easy to use for a situation like this. Simply enable it, then go to the settings page; add a "language" (just a custom set of translation strings for your site) and then enter the string you want to translate and the translation.

    If you're running Drupal 5, you might also want to check out the localizer module for additional options.

    : My task is not a translation per se: I just need to take the View and Edit tabs in the users page and change them into something else without interfering with other content types. The problem with Locale (and plugins like String Override) is that they translate too indiscriminately.
    Chris Charabaruk : What do you mean String Override translates too indiscriminately?
  • You could just create an alias for it. For instance make one for "forums" to point to alias "forum."

  • If you're simply looking to change the title of say, the 'My account' page or 'Create content' page, or any other default Drupal page, for that matter, you can modify the menu items themselves by heading to 'domain.com/admin/build/menu/list'.

    For example, if you wanted to change the title of 'My account' to 'Your account', you would find the menu titled 'Navigation' within the menu listing page at '/admin/build/menu/list'. The 'Navigation' menu is located at '/admin/build/menu-customize/navigation'. Find the menu item 'My account', and click 'Edit'. From there, you can modify the title of the menu item.

    Chris Charabaruk : Some menu items are locked and can't be renamed that way. But for a lot of them, yeah, that works.
  • If you use Drupal 6 you have access to the menu_alter and menu_link_alter hooks. if you can't make the needed changes via the regular administration options you could create a module which implements one or both of these hooks so that you can change the generated menu items when the menu_router table contents are built.

  • http://drupalmodules.com/module/string-overrides

  • Great post

0 comments:

Post a Comment