English 中文(简体)
Drupal join on taxonomy terms
原标题:

I have a Drupal setup like this:

  • Content type: Apartments
  • Vocabulary: Areas, that can be used with Apartments.
  • Content type: User profile, with a Content Taxonomy Field for Areas so users can select what areas they are interested in.

I would like a view that shows all the user profiles that matches the apartments in their area. A "User profile <-> Areas <-> Apartments" join in other words. I ve been mucking around with the views interface for a while but it s not clear to me how the relations can be setup to achieve this. Can someone give me a hint?

In case this cannot be easily solved with views, what is a good way of doing it otherwise? Thanks for your help.

最佳回答
问题回答

In my experience I ve found that views doesn t do taxonomy very well. It s often quite hard to get what you want and then you sometime strugle with duplicates. Often I ve found myself hitting a dead end using views for this.

In this case I would probably do this in a custom module. You don t have to do much. You should be able to make a simple query where you get all apartment nodes that has the same tid as the user profile. Then it s just a matter of what info you want to pull out. You should avoid making node_load() as it ll slow the page down a lot.





相关问题
Drupal Multi-language: Simple strings not translated

I m adding additional languages to a Drupal site that I m building. Getting the translation of content working is fairly easy using the Internationalisation module. Yet, simple things such as date ...

Setting up a WYSIWYG editor for Drupal site users [closed]

Looking through the Drupal contrib modules, and after a few Google searches, it becomes evident that there are any number of choices and combos available to set up a WYSIWYG editor in Drupal. I m ...

Change size of user/password login box

I don t know how to change the size of the login username/password boxes on the drupal site that I m trying to build. I m stumbling through the theming, and don t know where to find the file that ...

How does Drupal provide an edit/review/publish model?

How does Drupal support a means to update and review a website before it is published? Does it only allow you to preview a page at a time before you publish it or is there a way to create a site ...

Term for rotating header

I m looking for terminology that describes this behavior: The header of a web-page contains a different image every time you visit it. Update: It is not an advertisement, but images related to the ...

Has anyone checked out Drupal 7? [closed]

Has anyone checked out a copy of Drupal 7 yet? What do people think? I m pretty excited about the PDO and all of the designers I work with a very excited about the new admin interface/structure. Do ...

热门标签