更改 Drupal 节点删除确认表单上的标题
当您尝试删除 Drupal 中的节点时,您将进入一个确认页面,其标题为...
您确定要删除{节点标题}吗?
我正在尝试更改此页面的标题,但没有成功。我在主题和模块级别尝试了以下方法,但没有成功:
hook_form_node_delete_confirm_alter(...)
template_preprocess_html(&$vars)
template_preprocess_page(&$vars)
template_preprocess_region(&$vars)
template_confirm_form(&$vars)
我还无法在开发主题中找到任何有用的内容。
Drupal 7,请。
When you attempt to delete a node in Drupal, you're taken to a confirmation page whose title is...
Are you sure you want to delete {title of node}?
I'm attempting to alter the title of this page and have had no luck at all. I've tried the following at theme and module levels to no avail:
hook_form_node_delete_confirm_alter(...)
template_preprocess_html(&$vars)
template_preprocess_page(&$vars)
template_preprocess_region(&$vars)
template_confirm_form(&$vars)
I was additionally unable to find anything useful in devel themer.
Drupal 7, please.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这对我来说就像一个魅力:
确保在实现钩子后清除 Drupal 的缓存,否则它可能不会被拾取。
This works like a charm for me:
Make sure you clear Drupal's caches after you've implemented the hook or it might not be picked up.
我有一个适用于 Drupal 8 的模块,可以让您从节点类型编辑表单的配置中进行设置。 https://www.drupal.org/project/node_form_overrides
I have a module for Drupal 8 that lets you set this in config from the node type edit form. https://www.drupal.org/project/node_form_overrides