开发者

How to change the label of view/results buttons in Webform drupal-7

开发者 https://www.devze.com 2023-03-09 09:54 出处:网络
I am a newbie in drupal, webform and php. Actually I have installed the drupal-7 with the webform module and I want to modify the text of options i.e. \"view\" to \"create project\" and \"Results\" to

I am a newbie in drupal, webform and php. Actually I have installed the drupal-7 with the webform module and I want to modify the text of options i.e. "view" to "create project" and "Results" to "View Projects"... I searched for solution and I noticed that best option is to create a custom module and use hook_form_alter() to modify, so I have created a custom module. But I dont kno开发者_JS百科w how I can modify.

Kindly excuse me if the solution is already there (I could not find it :( )


"View" and "Results" are actually menu items, which you can modify by implementing hook_menu_alter().

http://drupal.org/node/483324

The following code in a custom module (change MODULENAME to the name of your module) will update the "Results" tab without a hitch, however the "View" tab is trickier because that's the core "view node" menu item. The code below will update this menu item for ALL node types, not just webforms. If you don't see the changes, clear your cache.

As far as I know there is no way to alter menu items ("View" in this case) for specific node types. See http://drupal.org/node/754508 for some attempts and discussion.

function MODULENAME_menu_alter(&$items) {
  // change webform "Results" to "View Projects"
  $items['node/%webform_menu/webform-results']['title'] = t('View Projects');
  // change "View" to "Create Project" - affects *all* node types, not just webforms
  $items['node/%node/view']['title'] = t('Create Project');
}


Ey I found one easy way to change everything in everything drupal 7 maybe in others try the moduls to install is String Overrides, link: http://drupal.org/project/stringoverrides, then you put the name in the configuration username and the newname

I hope this information is useful

add a picture how! >> http://s2.subirimagenes.com/otros/previo/thump_7143242string.jpg

0

精彩评论

暂无评论...
验证码 换一张
取 消