使用 SQL 提取 Drupal 节点和菜单关系
我正在尝试使用自定义 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可能想看看视图模块,它可以节省您大量时间并节省您编写自定义 SQL 的时间。
You may want to look at the views module, it can save you a lot of time and save you writing custom SQL.