有人知道如何向 /ADMIN/CONTENT 列表页面添加字段或列吗?德鲁帕尔7

发布于 2024-12-10 02:01:37 字数 201 浏览 1 评论 0原文

我想向内容管理概述页面添加一个字段/列,但似乎最简单的主题覆盖已在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

你的背包 2024-12-17 02:01:37

对我来说,使用这两个模块非常简单:

  1. 视图批量操作 (VBO)
  2. 管理视图(需要 VBO)

一旦两个模块安装并激活,您就可以转到您的视图(admin/struct/views)现在出现 3 个附加视图(管理注释、管理节点、管理用户)。然后,您只需编辑视图“管理节点”,您可以在其中添加和排列您想要的所有内容,就像通常使用视图一样。

我想添加一列显示所有内容的 nids。效果超级好!

For me it was super easy with these two modules:

  1. views bulk operations (VBO)
  2. administration views (needs VBO)

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!

噩梦成真你也成魔 2024-12-17 02:01:37

您必须挂钩到表单,主题元素已在 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 as node_admin_nodes() is no longer a form function, it just builds up elements that are used by node_admin_content().

Fortunately the elements in node_admin_nodes() and node_filter_form() (the two functions used in node_admin_content() to build up the page) are nicely structured and will be very easy to override.

还不是爱你 2024-12-17 02:01:37

我已经能够将一个元素添加到表格底部。虽然我不确定你如何将列添加到表体中?

function seven_form_alter(&$form, &$form_state, $form_id) {
        drupal_set_message("Form ID is : " . $form_id);

        //get node_admin_content
        //$nodeAdmin = drupal_get_form("node_admin_content");


          // Add a checkbox to registration form about agreeing to terms of use.
  $form['node_admin_content']['poland'] = array(
    '#type' => 'checkbox', 
    '#title' => t("I agree with the website's terms and conditions."), 
    '#required' => TRUE,
  );

}

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?

function seven_form_alter(&$form, &$form_state, $form_id) {
        drupal_set_message("Form ID is : " . $form_id);

        //get node_admin_content
        //$nodeAdmin = drupal_get_form("node_admin_content");


          // Add a checkbox to registration form about agreeing to terms of use.
  $form['node_admin_content']['poland'] = array(
    '#type' => 'checkbox', 
    '#title' => t("I agree with the website's terms and conditions."), 
    '#required' => TRUE,
  );

}
夢归不見 2024-12-17 02:01:37

管理视图模块用真实视图替换了许多管理列表(如视图模块),您可以按照您想要的方式进行编辑和配置。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文