使用 SQL 提取 Drupal 节点和菜单关系

发布于 2024-10-05 19:03:00 字数 546 浏览 0 评论 0原文

我正在尝试使用自定义 SQL 报告来理清复杂的多语言 Drupal 站点。
通过摸索,我能够构建这个 SQL 语句,它为我提供了所有节点并帮助我找到翻译关系。

SELECT  node.nid as node_nid, node.language as node_language, 
        node.type as node_type, node.title as node_title, 
        node.tnid as node_tnid, node.status as node_status, url.src, 
        url.dst, url.language as url_language 
FROM {node} as node 
LEFT JOIN {url_alias} as url 
      ON url.src = CONCAT('node/', node.nid) 
ORDER BY node_type, node_language, node.nid

现在我想为每个节点添加“允许的输入格式”和发布选项。还列出所有菜单及其包含的内容。

I am trying to untangle a complicated multi language Drupal site with custom SQL reports.
By poking around I bit I was able to construct this SQL statement which gives me all nodes and helps me find translation relationships.

SELECT  node.nid as node_nid, node.language as node_language, 
        node.type as node_type, node.title as node_title, 
        node.tnid as node_tnid, node.status as node_status, url.src, 
        url.dst, url.language as url_language 
FROM {node} as node 
LEFT JOIN {url_alias} as url 
      ON url.src = CONCAT('node/', node.nid) 
ORDER BY node_type, node_language, node.nid

Now I want to add 'permitted input formats' and publishing options for each node. Also list all menus and what they contain.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

一萌ing 2024-10-12 19:03:00

您可能想看看视图模块,它可以节省您大量时间并节省您编写自定义 SQL 的时间。

You may want to look at the views module, it can save you a lot of time and save you writing custom SQL.

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