如何更改 Webform drupal-7 中视图/结果按钮的标签
我是 drupal、webform 和 php 的新手。实际上我已经安装了带有 webform 模块的 drupal-7,我想修改选项的文本,即“视图”为“创建项目”,“结果”为“查看项目”... 我搜索了解决方案,我注意到最好的选择是创建一个自定义模块并使用 hook_form_alter() 进行修改,所以我创建了一个自定义模块。但我不知道如何修改。
如果解决方案已经存在,请原谅我(我找不到它:()
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 know how I can modify.
Kindly excuse me if the solution is already there (I could not find it :( )
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
“View”和“Results”实际上是菜单项,您可以通过实现
hook_menu_alter()
来修改它们。http://drupal.org/node/483324
自定义模块中的以下代码(将 MODULENAME 更改为模块的名称)将顺利更新“结果”选项卡,但是“视图”选项卡比较棘手,因为这是核心“视图节点”菜单项。下面的代码将为所有节点类型(而不仅仅是 Web 表单)更新此菜单项。如果您没有看到更改,请清除缓存。
据我所知,无法更改特定节点类型的菜单项(在本例中为“视图”)。请参阅 http://drupal.org/node/754508 进行一些尝试和讨论。
"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.
嗯,我发现了一种简单的方法来改变 drupal 7 中的所有内容,也许在其他尝试安装的模块是字符串覆盖,链接: http://drupal.org/project/stringoverrides,然后你将名称放入配置用户名和新名称中
我希望此信息有用
添加图片如何! >>> http://s2.subirimagenes.com/otros/previo/thump_7143242string.jpg
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