问题描述
...或者换句话说,如何在SQL中创建一个简单的连接?
假设我想要以下信息:
只是一个例子:
- 一个人的全名 $ b $他的全名是一个(内容资料)节点类型'name_and_address',他的兴趣是在'hobbies'。
- a person's full name
- a person's hobbies.
在SQL中,我将它们链接在一起,由node.uid。
我看过一些关于使用关系,但是与用户节点参考。
我只想从一个内容类型和另一个内容类型中使用相同的用户。
现在我可以在1视图中获得他的名字和他的爱好吗? p>
有一个如何做这个工作吗?
如果没有...
可以使用自定义联接,过滤器等进行扩展。如果您幸运的话,将会有一个模块。一些模块甚至提供自己的视图插件。
尽管文档有点零碎,您可以编写自己的视图插件。
另一件应该注意的是,意见并不总是答案。有时编写一个自定义查询和显示处理程序会做更多的麻烦。
...or, in other words, how to create a simple join as I would do in SQL?
Suppose I want the following information:
Just as an example:
His full name is in a (content profile) node type 'name_and_address' and his hobbies are in 'hobbies'.
In SQL, I would link them together by node.uid.I've seen a bit about using relationships, but that goes with user-node-refs.I just want the same user from one content-type and the other.
Now how could I get his name and his hobbies in 1 view?
There is a how to here does this do the job?
If not...
Views can be extended with custom joins, filters etc. If you are lucky there will be a module for this already. Some modules even provide their own views plugins.
You can write your own views plugins, although the documentation is a little fragmented.
The other thing that should be noted is that views isn't always the answer. Sometimes writing a custom query and display handler will do what you want with much less hassle.
这篇关于Drupal:从视图2中的多个节点类型检索数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!