有人知道如何向 /ADMIN/CONTENT 列表页面添加字段或列吗?德鲁帕尔7
我想向内容管理概述页面添加一个字段/列,但似乎最简单的主题覆盖已在 D7 中被弃用。
在 D6 中,我可以重写该方法:
theme_node_admin_nodes($form)
但此方法在 D7 中不再存在。等效的替代是什么,或者我实际上需要现在连接到 node_admin_nodes() 并直接修改表单吗?
I would like to add a field / column to the Content Administration Overview page but it appears the easiest theme override to do this has been deprecated with D7.
In D6 I could just override the method:
theme_node_admin_nodes($form)
But this method no longer exists for D7. What's the equivalent replacement or do I actually need to hook into node_admin_nodes() now and modify the form directly?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
对我来说,使用这两个模块非常简单:
一旦两个模块安装并激活,您就可以转到您的视图(admin/struct/views)现在出现 3 个附加视图(管理注释、管理节点、管理用户)。然后,您只需编辑视图“管理节点”,您可以在其中添加和排列您想要的所有内容,就像通常使用视图一样。
我想添加一列显示所有内容的 nids。效果超级好!
For me it was super easy with these two modules:
As soon as both modules are installed and activated you can go to your views (admin/structure/views) where now 3 additional views appear (Administration comments, Administration nodes, Administration users). You then just need to edit the view "Administration nodes", where you can add and arrange everything you want as usually with views.
I wanted to add a column displaying all content's nids. Worked super well!
您必须挂钩到表单,主题元素已在 Drupal 7 中完全删除
node_admin_nodes()
。您实际上需要挂钩的是
node_admin_content()
因为node_admin_nodes()
不再是一个表单函数,它只是构建node_admin_content()
使用的元素。幸运的是,
node_admin_nodes()
和node_filter_form()
中的元素(node_admin_content()
中用于构建页面的两个函数)结构良好并且很容易被覆盖。You'll have to hook into the form, the theme element has been completely removed
node_admin_nodes()
in Drupal 7.It's actually
node_admin_content()
that you'll need to hook into asnode_admin_nodes()
is no longer a form function, it just builds up elements that are used bynode_admin_content()
.Fortunately the elements in
node_admin_nodes()
andnode_filter_form()
(the two functions used innode_admin_content()
to build up the page) are nicely structured and will be very easy to override.我已经能够将一个元素添加到表格底部。虽然我不确定你如何将列添加到表体中?
I've been able to add an element to the bottom of the table. Although I am unsure how you ADD a coloumn into the body of the table?
管理视图模块用真实视图替换了许多管理列表(如视图模块),您可以按照您想要的方式进行编辑和配置。
The Administration Views module replaces a lot of admin listings with real views (as in Views module) that you can edit and configure any way you want it.